/* ===========================
   DESIGN TOKENS
=========================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Sora:wght@400;500;600;700&display=swap');

:root {
    --brand-primary:   #f59e0b;
    --brand-secondary: #ef4444;
    --brand-accent:    #0ea5e9;

    --surface-0:  #0f1117;
    --surface-1:  #181c27;
    --surface-2:  #1e2336;
    --surface-3:  #252b40;
    --surface-4:  #2e3550;

    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #475569;

    --border:         rgba(255,255,255,0.07);
    --border-strong:  rgba(255,255,255,0.13);

    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    --shadow-sm:  0 2px 8px rgba(0,0,0,0.25);
    --shadow-md:  0 8px 28px rgba(0,0,0,0.35);
    --shadow-lg:  0 20px 60px rgba(0,0,0,0.45);

    --font-display: 'Sora', sans-serif;
    --font-body:    'DM Sans', sans-serif;

    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   RESET
=========================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   BODY
=========================== */
body {
    font-family: var(--font-body);
    background-color: var(--surface-0);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245,158,11,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(14,165,233,0.10) 0%, transparent 55%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 28px 20px;
    line-height: 1.6;
}

/* ===========================
   CONTAINER
=========================== */
.container {
    max-width: 1240px;
    margin: 0 auto;
}

/* ===========================
   HEADER
=========================== */
.header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    position: relative;
}

.header h2::after {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 99px;
    margin-top: 6px;
}

/* ===========================
   FORM BOX (outer grid)
=========================== */
.form-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 24px;
}

/* ===========================
   CARD
=========================== */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
}

/* Top accent stripe */
.card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0.85;
}

/* Subtle glow blob */
.card::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.07) 0%, transparent 70%);
    top: -60px;
    right: -60px;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

/* ===========================
   CARD TITLE
=========================== */
.card h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    flex-shrink: 0;
}

/* ===========================
   INNER FORM GRID
=========================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
hr {
    display: none;
}
/* ===========================
   INPUTS / SELECT / TEXTAREA
=========================== */
input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13.5px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

input:hover, select:hover, textarea:hover {
    background: var(--surface-3);
    border-color: rgba(255,255,255,0.18);
}

input:focus, select:focus, textarea:focus {
    background: var(--surface-3);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.18);
}

/* select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

select option {
    background: var(--surface-2);
    color: var(--text-primary);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* ===========================
   BUTTON
=========================== */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--brand-primary), #f97316);
    color: #0f1117;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    margin: 18px 0 4px;
    box-shadow: 0 4px 16px rgba(245,158,11,0.28);
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition);
}

button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(245,158,11,0.38);
    filter: brightness(1.06);
}

button:hover::after {
    background: rgba(255,255,255,0.08);
}

button:active {
    transform: translateY(0) scale(0.98);
}

/* Secondary / ghost button variant */
button.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

button.btn-ghost:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: none;
    filter: none;
}

/* ===========================
   SEARCH BOX
=========================== */
.search-box {
    margin: 22px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

/* ===========================
   TABLE WRAPPER
=========================== */
.table-wrapper {
    margin-top: 24px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* ===========================
   TABLE
=========================== */
table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--surface-2);
}

table th {
    padding: 13px 16px;
    text-align: left;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}

table th:first-child { padding-left: 20px; }
table td:first-child { padding-left: 20px; }

table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text-primary);
    vertical-align: middle;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr {
    transition: background var(--transition);
}

table tbody tr:hover {
    background: var(--surface-2);
}

/* ===========================
   TAGS
=========================== */
.type-import {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4ade80;
    background: rgba(74,222,128,0.12);
    border: 1px solid rgba(74,222,128,0.22);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.type-import::before {
    content: '↓';
    font-size: 11px;
}

.type-export {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #f87171;
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.22);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.type-export::before {
    content: '↑';
    font-size: 11px;
}

/* ===========================
   LINK / BUTTON LINK
=========================== */
a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    border-radius: 99px;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
    margin-top: 12px;
}

a:hover {
    background: var(--surface-4);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-1px);
}

/* ===========================
   LOGIN PAGE
=========================== */
.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--surface-0);
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(245,158,11,0.13) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 80% 90%, rgba(14,165,233,0.09) 0%, transparent 55%);
}

.login-box {
    width: 380px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    padding: 40px 36px 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), var(--brand-accent));
}

/* Logo / brand mark area */
.login-box::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%);
    top: -80px;
    right: -60px;
    pointer-events: none;
}

.login-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.login-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.5;
}

.login-form input {
    margin-bottom: 12px;
}

.login-form button {
    width: 100%;
    margin: 8px 0 0;
    padding: 12px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

/* ===========================
   ERROR
=========================== */
.error {
    color: #f87171;
    font-size: 13px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(248,113,113,0.10);
    border: 1px solid rgba(248,113,113,0.22);
    border-radius: var(--radius-sm);
}

/* ===========================
   SCROLLBAR
=========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-0); }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeUp 0.4s ease both;
}

.card:nth-child(2) { animation-delay: 0.07s; }
.card:nth-child(3) { animation-delay: 0.14s; }
.card:nth-child(4) { animation-delay: 0.21s; }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    body { padding: 16px; }

    .form-box {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .header h2 { font-size: 22px; }

    .login-box {
        width: 100%;
        max-width: 400px;
        padding: 32px 24px 28px;
    }

    .search-box { flex-direction: column; }
    .search-box input { padding-left: 14px; background-image: none; }
}