/* ============================================
   GENERAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0e8c7f;
    --primary-color-light: #2bb3a3;
    --secondary-color: #15262f;
    --success-color: #22a06b;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f3f6f7;
    --white: #ffffff;
    --text-dark: #1e2a32;
    --text-light: #65767c;
    --border-color: #d7dee0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.15);
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

img, iframe, pre, code {
    max-width: 100%;
}

/* ============================================
   ICONS (inline SVG via the icon() helper)
   ============================================ */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: -0.2em;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

.icon-xl {
    width: 48px;
    height: 48px;
}

.btn .icon {
    width: 14px;
    height: 14px;
}

/* ============================================
   LANGUAGE DROPDOWN
   ============================================ */
.lang-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 7px 10px;
    color: inherit;
}

.lang-dropdown-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.lang-dropdown-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: inherit;
    padding-right: 14px;
    cursor: pointer;
}

.lang-dropdown-select:focus {
    outline: none;
}

.lang-dropdown-select option {
    color: var(--text-dark);
}

.lang-dropdown-chevron {
    width: 11px;
    height: 11px;
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* On the light auth card, the dropdown needs a darker tint than on the dark sidebar/topbar */
.auth-box .lang-dropdown {
    background: var(--light-bg);
    color: var(--text-dark);
}

/* ============================================
   AUTH PAGE STYLES
   ============================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
}

.auth-box {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-switcher {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.lang-link {
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 4px 8px;
    border-radius: 3px;
}

.lang-link:hover,
.lang-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(14, 140, 127, 0.1);
}

.lang-divider {
    color: var(--border-color);
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo img {
    width: 120px;
    height: auto;
    object-fit: contain;
}

.auth-box h1 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 25px;
}

.auth-instruction {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.forgot-password-link {
    text-align: center;
    margin-top: 15px;
}

.forgot-password-link a {
    color: var(--primary-color);
    font-size: 13px;
    text-decoration: none;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-form .btn {
    margin-top: 25px;
    width: 100%;
}

.form-group {
    margin-bottom: 30px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    margin-top: 20px;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 14px;
}

.form-group:first-child label {
    margin-top: 0;
}

/* Inside a .form-row grid, every field sits on the same line as its
   row-mates - the row's own gap already spaces it from the row above, so
   none of them should carry the standalone-field top margin (previously
   only the left-hand .form-group matched :first-child, leaving the right-
   hand one pushed down and out of alignment with its partner). */
.form-row .form-group label {
    margin-top: 0;
}

.form-group input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    line-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    margin-bottom: 0;
    box-sizing: border-box;
}

.form-group input[type="file"] {
    height: auto;
    line-height: normal;
    padding: 10px 12px;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    line-height: 1.5;
    resize: vertical;
    min-height: 160px;
    box-sizing: border-box;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.1);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: var(--light-bg);
    color: var(--text-light);
    cursor: not-allowed;
}

.field-hint code {
    background: var(--light-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.email-template-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning-color);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.email-template-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.email-template-actions .btn {
    width: auto;
    margin-top: 0;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.1);
}

.auth-switch {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.organization-notice {
    margin-top: 20px;
    padding: 12px 15px;
    background-color: #e7f3ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-size: 13px;
    color: #004085;
    line-height: 1.5;
}

.demo-banner {
    margin-bottom: 20px;
    padding: 16px 18px;
    background-color: #e7f3ff;
    border: 1px solid #b8dcff;
    border-radius: 8px;
    text-align: left;
}

.demo-banner-title {
    font-weight: 700;
    color: #004085;
    margin-bottom: 10px;
    font-size: 14px;
}

.demo-banner-creds {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.demo-cred-label {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.demo-cred-value {
    background: #fff;
    border: 1px solid #b8dcff;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 13px;
    color: var(--secondary-color);
}

.demo-fill-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar: always visible now - carries the page title, notification bell,
   language switcher and logout button on both desktop and mobile. The
   hamburger (to open the off-canvas sidebar) only appears on mobile. */
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--secondary-color);
    color: var(--white);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 1002;
    box-shadow: var(--shadow);
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 6px;
    align-items: center;
    border-radius: 6px;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-btn .icon {
    width: 22px;
    height: 22px;
}

.topbar-title {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar .lang-dropdown {
    flex-shrink: 0;
}

.topbar-logout {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

.topbar-logout:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.topbar-logout .icon {
    width: 16px;
    height: 16px;
}

/* Notification bell */
.notif-bell-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-bell-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    position: relative;
}

.notif-bell-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.notif-bell-btn .icon {
    width: 20px;
    height: 20px;
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color, #e74c3c);
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    color: var(--text-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    overflow: hidden;
}

.notif-dropdown.open {
    display: block;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.notif-dropdown-header a {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.notif-dropdown-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light-bg);
    color: var(--text-color);
    text-decoration: none;
}

.notif-item:hover {
    background: var(--light-bg);
}

.notif-item.unread {
    background: #f0f7ff;
}

.notif-item-message {
    font-size: 13px;
    font-weight: 600;
}

.notif-item-time {
    font-size: 11px;
    color: #888;
}

.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.sidebar-backdrop {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--secondary-color);
    color: var(--white);
    padding: 30px 20px;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.sidebar-logo-box {
    background: var(--white);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.sidebar-logo-img {
    max-width: 150px;
    max-height: 40px;
    display: block;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 30px;
}

.nav-item {
    padding: 12px 15px;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(14, 140, 127, 0.3);
    color: var(--white);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-footer p {
    font-size: 13px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.btn-logout {
    width: 100%;
    background: linear-gradient(180deg, #f3a93f 0%, var(--warning-color) 100%);
    color: var(--white);
    box-shadow: 0 2px 5px rgba(243, 156, 18, 0.35);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 16px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #e3f2f1;
    color: #0b5a50;
    border: 1px solid #bfe3df;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: inherit;
    padding: 0;
}

.close-btn:hover {
    opacity: 0.7;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    position: relative;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.btn:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

.btn:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary-color-light) 0%, var(--primary-color) 100%);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(14, 140, 127, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 4px 10px rgba(14, 140, 127, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: var(--light-bg);
    border-color: var(--text-light);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    filter: brightness(1.08);
}

.btn-small {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-view {
    background: linear-gradient(180deg, var(--primary-color-light) 0%, var(--primary-color) 100%);
    color: var(--white);
    box-shadow: 0 2px 5px rgba(14, 140, 127, 0.3);
}

.btn-share {
    background: linear-gradient(180deg, #31ba6f 0%, #27ae60 100%);
    color: var(--white);
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
}

.btn-delete {
    background: linear-gradient(180deg, #ec6a5c 0%, var(--danger-color) 100%);
    color: var(--white);
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
}

/* Icon-only action buttons: a subtle color-tinted circle at rest, filling
   solid on hover. Used for file-card / file-table actions (preview,
   download, share, delete) where a label would just add clutter. */
.btn-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon .icon {
    width: 16px;
    height: 16px;
}

.btn-icon-view {
    background: rgba(14, 140, 127, 0.12);
    color: var(--primary-color);
}

.btn-icon-view:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-icon-download {
    background: rgba(44, 62, 80, 0.1);
    color: var(--secondary-color);
}

.btn-icon-download:hover {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-icon-share {
    background: rgba(39, 174, 96, 0.12);
    color: var(--success-color);
}

.btn-icon-share:hover {
    background: var(--success-color);
    color: var(--white);
}

.btn-icon-delete {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger-color);
}

.btn-icon-delete:hover {
    background: var(--danger-color);
    color: var(--white);
}

/* ============================================
   UPLOAD SECTION
   ============================================ */
.upload-section {
    margin-bottom: 40px;
}

.upload-box {
    background: var(--white);
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.upload-box:hover,
.upload-box.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(14, 140, 127, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-form {
    cursor: pointer;
}

.upload-input-wrapper {
    position: relative;
}

#fileInput {
    display: none;
}

.upload-icon {
    display: flex;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-section h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 18px;
}

.upload-section p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 5px;
}

.file-size-info {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 10px;
}

/* ============================================
   FILES SECTION
   ============================================ */
.files-section {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
}

.section-header h2 {
    color: var(--secondary-color);
    font-size: 24px;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-width: 220px;
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.file-preview {
    width: 100%;
    height: 150px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdf-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: var(--danger-color);
    font-weight: 700;
}

.pdf-icon .icon {
    width: 32px;
    height: 32px;
}

.file-info {
    padding: 16px 16px 12px;
    flex: 1;
}

.file-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.file-meta .file-meta-sep {
    color: var(--border-color);
}

.file-actions {
    padding: 10px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-top: 1px solid var(--light-bg);
    margin-top: 4px;
    padding-top: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-light);
}

.empty-icon {
    display: flex;
    justify-content: center;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-icon .icon {
    width: 64px;
    height: 64px;
}

.empty-state h3 {
    color: var(--secondary-color);
    font-size: 22px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light-bg);
    background: var(--light-bg);
}

.modal-header h2 {
    color: var(--secondary-color);
    font-size: 20px;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--secondary-color);
}

.modal-form {
    padding: 20px;
}

.modal-form .form-group {
    margin-bottom: 15px;
}

.modal-form .btn {
    width: 100%;
    margin-top: 10px;
}

/* ============================================
   SETTINGS PAGE STYLES
   ============================================ */
.settings-section {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.settings-card {
    margin-bottom: 30px;
}

.settings-card h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 20px;
}

.field-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

/* Admin Panel: tabbed layout */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.admin-tab-btn .icon {
    width: 16px;
    height: 16px;
}

.admin-tab-btn:hover {
    color: var(--secondary-color);
}

.admin-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    align-items: start;
}

.settings-panel {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 26px;
    min-width: 0;
}

.settings-panel h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-panel .muted {
    color: var(--text-light);
    font-size: 13px;
    margin-top: -10px;
    margin-bottom: 18px;
}

.settings-form {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 0;
    min-width: 0;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    max-width: 100%;
    height: 46px;
    padding: 0 36px 0 12px;
    line-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 140, 127, 0.1);
}

.settings-form .btn {
    width: 100%;
    margin-top: 20px;
}

.settings-info {
    background: rgba(14, 140, 127, 0.05);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
}

.settings-info p {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 12px;
}

.settings-info ul {
    list-style: none;
    padding: 0;
}

.settings-info li {
    padding: 8px 0;
    color: var(--text-dark);
    font-size: 13px;
}

.email-preview-form {
    margin-bottom: 16px;
}

.email-preview-frame {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.email-preview-subject {
    background: var(--light-bg);
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.email-preview-iframe {
    width: 100%;
    height: 320px;
    border: none;
    background: white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .topbar {
        gap: 8px;
        padding: 12px 16px;
    }

    .hamburger-btn {
        display: flex;
    }

    /* Icon-only on mobile: the select stays functionally present (an
       invisible full-cover tap target) but shows no text - just the
       translate icon in a round button. The full-label dropdown remains
       available inside the drawer's sidebar-lang-wrap once opened. */
    .topbar .lang-dropdown {
        flex-shrink: 0;
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        position: relative;
    }

    .topbar .lang-dropdown-select {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

    .topbar .lang-dropdown-chevron {
        display: none;
    }

    .topbar-logout span {
        display: none;
    }

    .notif-dropdown {
        right: -8px;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        width: 80%;
        max-width: 300px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 20px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .content-area {
        width: 100%;
        min-width: 0;
    }

    .sidebar-nav {
        gap: 6px;
    }

    .nav-item {
        padding: 12px 15px;
        font-size: 14px;
    }

    .main-content {
        padding: 15px;
        min-width: 0;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .file-preview {
        height: 120px;
    }

    .upload-section {
        margin-bottom: 30px;
    }

    .upload-box {
        padding: 30px 15px;
    }

    .upload-icon .icon {
        width: 36px;
        height: 36px;
    }

    .auth-box {
        padding: 30px 20px;
    }

    .auth-box h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .language-switcher .lang-dropdown {
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        position: relative;
    }

    .language-switcher .lang-dropdown-select {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

    .language-switcher .lang-dropdown-chevron {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-scroll table {
        width: auto;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar-header h2 {
        font-size: 18px;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 20px;
    }

    .dashboard-header {
        margin-bottom: 20px;
    }

    .dashboard-header h1 {
        font-size: 20px;
    }

    .section-header h2 {
        font-size: 18px;
    }
}

/* Copy Link Modal */
.modal-small {
    max-width: 320px;
}

.modal-wide {
    max-width: 580px;
}

.modal-wide .modal-form .form-row {
    margin-bottom: 0;
}

.modal-wide .modal-form .form-group {
    margin-bottom: 15px;
}

/* ============================================
   VAULT
   ============================================ */
.recovery-key-display {
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    background: var(--light-bg);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    word-break: break-all;
    user-select: all;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.vault-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.vault-status-locked {
    background: #fff7e6;
    border: 1px solid #f3dca0;
    color: #8a5a00;
}

.vault-status-unlocked {
    background: #e6f7f1;
    border: 1px solid #a9e2cc;
    color: #0d7a52;
}

.credential-password-cell {
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 13px;
}

.danger-zone {
    border: 1px solid #f5b8b8;
    border-radius: 10px;
    padding: 20px;
    background: #fef8f8;
}

.danger-zone h3 {
    color: var(--danger-color);
    font-size: 15px;
    margin-bottom: 8px;
}

.modal-content {
    background-color: var(--white);
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

.modal-body {
    padding: 50px 40px;
}

.copy-status-icon {
    color: #27ae60;
    margin: 0 0 12px 0;
    display: flex;
    justify-content: center;
}

.copy-status-icon .icon {
    width: 56px;
    height: 56px;
}

#copyModalMessage {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
    letter-spacing: 0.3px;
}

/* ============================================
   LINK IN BIO - EDITOR
   ============================================ */
.bio-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
    min-width: 0;
}

.bio-layout > * {
    min-width: 0;
}

.bio-editor .settings-section {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.bio-url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    color: var(--text-dark);
    min-width: 0;
}

.bio-url-box code {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 13px;
    color: var(--secondary-color);
}

.bio-unpublished-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--warning-color);
    font-size: 13px;
    margin-bottom: 14px;
}

.bio-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.bio-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.bio-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bio-switch-track {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.bio-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.bio-switch input:checked + .bio-switch-track {
    background: var(--success-color);
}

.bio-switch input:checked + .bio-switch-track .bio-switch-thumb {
    transform: translateX(20px);
}

.bio-link-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bio-link-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.bio-link-row.bio-link-hidden {
    opacity: 0.55;
}

.bio-link-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bio-link-info strong {
    font-size: 14px;
    color: var(--secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bio-link-url {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bio-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.bio-link-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.15s ease;
}

.btn-icon .icon {
    width: 14px;
    height: 14px;
}

.btn-icon:hover:not(:disabled) {
    background: var(--light-bg);
    border-color: var(--text-light);
}

.btn-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-icon-danger:hover:not(:disabled) {
    background: #fdecea;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.bio-preview-pane {
    position: sticky;
    top: 20px;
}

.bio-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.bio-preview-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--secondary-color);
}

.bio-preview-toggle {
    display: flex;
    background: var(--light-bg);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.bio-preview-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
}

.bio-preview-toggle button.active {
    background: var(--white);
    color: var(--secondary-color);
    box-shadow: var(--shadow);
}

.bio-preview-toggle .icon {
    width: 14px;
    height: 14px;
}

.bio-preview-frame-wrap {
    background: var(--secondary-color);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.bio-preview-frame-wrap iframe {
    border: none;
    border-radius: 10px;
    background: var(--white);
    width: 100%;
}

.bio-preview-frame-wrap.mobile iframe {
    max-width: 320px;
    height: 600px;
}

.bio-preview-frame-wrap.desktop iframe {
    height: 600px;
}

/* ============================================
   LINK IN BIO - PUBLIC PAGE
   ============================================ */
.bio-public-body {
    background: linear-gradient(160deg, var(--secondary-color) 0%, #0e686c 100%);
    min-height: 100vh;
}

.bio-public-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.bio-public-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 36px 28px;
    text-align: center;
}

.bio-public-logo {
    max-width: 120px;
    max-height: 48px;
    object-fit: contain;
    margin: 0 auto 18px;
    display: block;
}

.bio-public-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.bio-public-card h1 {
    font-size: 22px;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.bio-public-tagline {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

.bio-public-preview-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff8e6;
    color: #8a6d1f;
    border: 1px solid #f0dca0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    margin-bottom: 20px;
}

.bio-public-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bio-public-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bio-public-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: var(--white);
    border-color: var(--primary-color);
}

.bio-public-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bio-public-empty {
    color: var(--text-light);
    font-size: 14px;
    padding: 20px 0;
}

.bio-public-footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-light);
}

.bio-public-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-light);
}

.bio-public-unavailable .icon {
    color: var(--border-color);
}

@media (max-width: 900px) {
    .bio-layout {
        grid-template-columns: 1fr;
    }

    .bio-preview-pane {
        position: static;
    }

    .bio-preview-frame-wrap.mobile iframe,
    .bio-preview-frame-wrap.desktop iframe {
        height: 500px;
    }
}

/* ============================================
   DOCUMENTATION
   ============================================ */
.doc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    align-items: start;
}

.doc-toc {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 16px;
}

.doc-toc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 6px;
}

.doc-toc a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13.5px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.doc-toc a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.doc-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.doc-section {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 26px 30px;
    scroll-margin-top: 20px;
}

.doc-section h2 {
    color: var(--secondary-color);
    font-size: 19px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
}

.doc-body {
    color: var(--text-dark);
    font-size: 14.5px;
    line-height: 1.7;
}

.doc-body p {
    margin-bottom: 12px;
}

.doc-body p:last-child {
    margin-bottom: 0;
}

.doc-body strong {
    color: var(--secondary-color);
}

.doc-body ul {
    margin: 0 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 900px) {
    .doc-layout {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .doc-toc {
        position: static;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 12px;
    }

    .doc-toc-label {
        display: none;
    }

    .doc-toc a {
        flex-shrink: 0;
        white-space: nowrap;
        background: var(--light-bg);
    }

    .doc-section {
        padding: 20px;
    }
}

/* ============================================
   DATA TABLES (Clients / Domains / Services)
   ============================================ */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.toolbar-filters input[type="text"],
.toolbar-filters input[type="search"] {
    min-width: 200px;
}

.toolbar-filters select {
    width: auto;
}

.data-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-bg);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: rgba(14, 140, 127, 0.04);
}

.data-table .row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.data-table .row-link {
    color: var(--text-dark);
    font-weight: 700;
    text-decoration: none;
}

.data-table .row-link:hover {
    color: var(--primary-color);
}

.row-sub {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
    margin-top: 2px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-pill-active {
    background: #e6f7f1;
    color: #0d7a52;
}

.status-pill-inactive,
.status-pill-cancelled {
    background: #f1f2f3;
    color: #65767c;
}

.status-pill-expired {
    background: #fef2f2;
    color: #991b1b;
}

.status-pill-expiring {
    background: #fff7e6;
    color: #a66a00;
}

/* ============================================
   DETAIL PAGES (Client / Domain views)
   ============================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 12px;
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link .icon {
    width: 14px;
    height: 14px;
}

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

.detail-header-text h1 {
    margin-bottom: 4px;
}

.detail-header-text p {
    color: var(--text-light);
    font-size: 14px;
}

.section-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-card-header h2 {
    font-size: 16px;
    color: var(--secondary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
}

.info-grid dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.info-grid dd {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
    word-break: break-word;
}

.notes-text {
    white-space: pre-wrap;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item p {
    font-size: 14px;
    white-space: pre-wrap;
}

.activity-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.add-note-form {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    align-items: flex-start;
}

.add-note-form textarea {
    flex: 1;
    min-height: 44px;
    resize: vertical;
}

.add-note-form .btn {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .add-note-form {
        flex-direction: column;
    }
    .add-note-form .btn {
        width: 100%;
    }
}
