:root {
    --font-sans: "Aptos", "Segoe UI Variable Text", "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-display: "Aptos Display", "Segoe UI Variable Display", "IBM Plex Sans", "Segoe UI", sans-serif;

    --bg: #edf4f8;
    --bg-elevated: #e5eef4;
    --surface: #ffffff;
    --surface-soft: #f7fbfd;
    --surface-muted: #eef5f8;

    --text: #13232e;
    --text-soft: #344a57;
    --text-muted: #6f8795;

    --border: rgba(20, 54, 73, 0.10);
    --border-strong: rgba(20, 54, 73, 0.18);

    --accent: #2f8f83;
    --accent-hover: #3ea596;
    --accent-soft: rgba(47, 143, 131, 0.12);
    --accent-soft-2: rgba(47, 143, 131, 0.06);
    --accent-border: rgba(62, 165, 150, 0.24);

    --success: #3f9b73;
    --success-bg: rgba(63, 155, 115, 0.12);

    --danger: #c96b63;
    --danger-bg: rgba(201, 107, 99, 0.10);

    --warning: #d2a85d;
    --warning-bg: rgba(210, 168, 93, 0.10);

    --shadow-lg: 0 18px 40px rgba(18, 49, 66, 0.08);
    --shadow-md: 0 12px 26px rgba(18, 49, 66, 0.07);
    --shadow-sm: 0 8px 18px rgba(18, 49, 66, 0.05);

    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at top, rgba(47, 143, 131, 0.10) 0%, transparent 24%),
        linear-gradient(180deg, #f6fbfd 0%, var(--bg) 100%);
    color: var(--text);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

body {
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-family: var(--font-display);
    color: var(--text);
}

.card-header p {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.94rem;
}

.chip {
    padding: 8px 12px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.93rem;
    font-weight: 600;
}

.alert.error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid rgba(201, 107, 99, 0.20);
}

.alert.success {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid var(--accent-border);
}

.primary-btn,
.generate-gpg-btn,
.secondary-btn {
      border: none;
      border-radius: 14px;
      padding: 12px 18px;
      font-weight: 700;
      cursor: pointer;
      text-decoration: none;
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  }

.primary-btn,
.generate-gpg-btn {
    color: #f3fbf8;
    box-shadow: 0 12px 26px rgba(17, 61, 56, 0.34);
      border: 1px solid rgba(151, 180, 194, 0.12);
    /* border-radius: 26px; */
    background: rgba(16, 33, 45, 0.96);
}

.primary-btn:hover,
.generate-gpg-btn:hover,
.secondary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    background: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-overflow-scrolling: touch;
}

.preview-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.82rem;
}

.preview-table thead th {
    position: sticky;
    top: 0;
    background: #f8fbfd;
    color: var(--text-soft);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    z-index: 1;
}

.preview-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(20, 54, 73, 0.08);
    color: var(--text-soft);
    font-size: 0.78rem;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    line-height: 1.4;
}

.preview-table tbody tr:hover {
    background: var(--accent-soft-2);
}

.preview-table th:nth-child(1),
.preview-table td:nth-child(1) {
    min-width: 130px;
    max-width: 130px;
}

.preview-table th:nth-child(2),
.preview-table td:nth-child(2),
.preview-table th:nth-child(3),
.preview-table td:nth-child(3) {
    min-width: 120px;
    max-width: 140px;
}

.preview-table th:nth-child(4),
.preview-table td:nth-child(4),
.preview-table th:nth-child(10),
.preview-table td:nth-child(10) {
    min-width: 120px;
    max-width: 120px;
}

.preview-table th:nth-child(7),
.preview-table td:nth-child(7) {
    min-width: 130px;
    max-width: 150px;
}

.empty-state {
    padding: 36px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    background: var(--surface-soft);
    text-align: center;
}

.empty-state h4 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--text);
}

.empty-state p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

input[type="file"],
.location-input,
.type-dropdown {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-soft);
}

input[type="file"] {
    flex: 1;
    min-width: 220px;
}

.location-input {
    min-width: 180px;
    max-width: 220px;
    font-size: 0.85rem;
}

.location-input::placeholder {
    color: #94a3b8;
}

.type-dropdown {
    min-width: 140px;
    font-size: 0.85rem;
}

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    min-width: 320px;
    max-width: 420px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.toast-hide {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.96);
}

.toast-success .toast-content {
    border-color: var(--accent-border);
    background: linear-gradient(180deg, #f7fffd 0%, #ffffff 100%);
}

.toast-error .toast-content {
    border-color: rgba(185, 28, 28, 0.16);
    background: linear-gradient(180deg, #fffafa 0%, #ffffff 100%);
}

.toast-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: var(--accent);
    color: #fff;
}

.toast-error .toast-icon {
    background: var(--danger);
    color: #fff;
}

.toast-text {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
}

.toast-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text);
}

@media (max-width: 768px) {
    .table-wrap {
        border-radius: 14px;
    }

    .preview-table {
        min-width: 1000px;
    }

    .preview-table thead th,
    .preview-table tbody td {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 18px;
    }

    .primary-btn,
    .generate-gpg-btn {
        width: 100%;
    }

    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        min-width: 0;
        max-width: none;
    }
}
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

img,
svg,
canvas,
video {
    max-width: 100%;
    display: block;
}

input,
select,
button,
textarea {
    outline: none;
}

input:focus,
select:focus,
button:focus,
textarea:focus {
    box-shadow: 0 0 0 4px rgba(47, 143, 131, 0.18);
    border-color: var(--accent-border);
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.18rem 0.45rem;
    border-radius: 8px;
    font-size: 0.9em;
}
