/* Core Variables */
:root {
    /* Primary Theme Colors */
    --primary-color: #304D6D;        /* Deep blue for primary actions */
    --primary-light: #4B6D9A;        /* Lighter version for hover states */
    --primary-dark: #1A3457;         /* Darker version for active states */
    --secondary-color: #3C9D9B;      /* Teal for secondary actions */
    --accent-color: #F7941E;         /* Orange accent for important elements */
    
    /* Neutral Colors */
    --neutral-50: #F9FAFB;           /* Lightest background */
    --neutral-100: #F3F4F6;          /* Light background */
    --neutral-200: #E5E7EB;          /* Border, divider */
    --neutral-300: #D1D5DB;          /* Disabled background */
    --neutral-400: #9CA3AF;          /* Disabled text */
    --neutral-500: #6B7280;          /* Secondary text */
    --neutral-600: #4B5563;          /* Primary text */
    --neutral-700: #374151;          /* Headings */
    --neutral-800: #1F2937;          /* Dark elements */
    --neutral-900: #111827;          /* Darkest elements */
    
    /* Status Colors */
    --success: #10B981;              /* Success/Approved */
    --success-light: #D1FAE5;
    --warning: #F59E0B;              /* Warning/Pending */
    --warning-light: #FEF3C7;
    --danger: #EF4444;               /* Error/Review Required */
    --danger-light: #FEE2E2;
    --info: #3B82F6;                 /* Information */
    --info-light: #DBEAFE;
    
    /* Last Signed Info Styling */
    --signed-color: #F59E0B;         /* Warning/Pending color for signed text */
    
    /* Typography */
    --font-main: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    --font-headings: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    --font-code: 'Roboto Mono', 'SF Mono', 'Consolas', monospace;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Sizing */
    --header-height: 60px;
    --sidebar-width: 250px;
    --container-max-width: 1280px;
    
    /* Borders and Shadows */
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    --border-radius-xl: 12px;
    --box-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
}

/* Main Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--neutral-700);
    background-color: var(--neutral-100);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: var(--space-6);
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Header */
header {
    background-color: var(--primary-dark);
    color: white;
    padding: 0;
    box-shadow: var(--box-shadow-md);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.left-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info-header {
    color: white;
    font-family: var(--font-main);
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.company-name-header {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.user-role-info {
    font-size: 0.85rem;
    opacity: 0.9;
}

.user-name-header {
    font-weight: 500;
}

.user-role-header {
    font-weight: 400;
    opacity: 0.8;
}

/* Notification Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: white;
    background-color: var(--danger);
    border-radius: 9999px;
    margin-left: 0.5rem;
}

.badge-accent {
    background-color: var(--accent-color);
}

.has-notifications {
    font-weight: 500;
    position: relative;
}

/* Messages Page Styles */
.messages-container {
    max-width: 850px;
    margin: 0 auto;
}

.message-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    margin-bottom: 1.25rem;
    overflow: hidden;
    border-left: 4px solid var(--accent-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    height: auto;
}

.message-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.message-header {
    padding: 0.7rem 1.2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.message-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.message-header h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 6px rgba(247, 148, 30, 0.8);
}

.message-timestamp {
    font-size: 0.8rem;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

.message-content {
    padding: 0.8rem 1.2rem 0.4rem;
    background-color: rgba(248, 250, 252, 0.8);
}

.message-details {
    margin: 0.3rem 0;
}

.message-detail {
    display: flex;
    margin-bottom: 0.6rem;
    align-items: center;
    border-bottom: 1px dashed var(--neutral-200);
    padding-bottom: 0.5rem;
}

.message-detail:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.message-detail-label {
    font-weight: 600;
    width: 100px;
    flex-shrink: 0;
    color: var(--primary-dark);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    position: relative;
    padding-left: 0.8rem;
}

.message-detail-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 14px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.message-detail-value {
    flex-grow: 1;
    font-size: 0.95rem;
    color: var(--neutral-700);
    font-weight: 500;
}

.document-id {
    font-family: var(--font-code);
    background: linear-gradient(to right, var(--info-light), var(--neutral-100));
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 0.03em;
    border: 1px solid var(--info-light);
    text-decoration: none;
    display: inline-block;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

a.document-id:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    background: linear-gradient(to right, var(--info-light), var(--info-light));
    color: var(--primary-color);
    text-decoration: none;
}

.message-actions {
    padding: 0.5rem 1.2rem;
    background-color: var(--neutral-50);
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--neutral-200);
}

.message-actions a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    border: 1px solid var(--primary-color);
    font-size: 0.9rem;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.message-actions a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.no-messages {
    padding: 4rem 3rem;
    text-align: center;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    color: var(--neutral-500);
    border-left: 4px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.no-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-light));
}

.no-messages::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(236, 246, 255, 0.3));
    z-index: 0;
}

.no-messages svg {
    stroke: var(--secondary-color);
    margin-bottom: 1.5rem;
    height: 64px;
    width: 64px;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 1;
}

.no-messages h3 {
    color: var(--primary-color);
    margin-bottom: 0.7rem;
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.no-messages p {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.no-messages-tip {
    font-size: 0.9rem !important;
    color: var(--neutral-400);
    margin-top: 1rem;
    font-style: italic;
}

/* Event-based message styling */
.message-card.event-ownership {
    border-left-color: var(--info);
}

.message-card.event-status {
    border-left-color: var(--warning);
}

.message-card.event-review {
    border-left-color: var(--success);
}

.message-card.event-approval {
    border-left-color: var(--accent-color);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-family: var(--font-headings);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: white;
    letter-spacing: 0.01em;
    line-height: 1;
}

.logo .slogan {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    margin-top: 0.2rem;
}

.logo img {
    height: 32px;
    margin-right: var(--space-3);
}

/* Navigation */
nav {
    height: 100%;
}

nav ul {
    list-style: none;
    display: flex;
    height: 100%;
}

nav ul li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    height: 100%;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-bottom: 3px solid transparent;
}

nav ul li a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid var(--accent-color);
}

nav ul li a.active {
    color: white;
    border-bottom: 3px solid var(--accent-color);
    font-weight: 600;
}

/* Dropdown Menu */
.dropdown-toggle {
    display: flex;
    align-items: center;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: var(--space-2);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.8);
    transition: transform var(--transition-fast);
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-lg);
    z-index: 1000;
    min-width: 220px;
    overflow: visible;
    height: auto; /* Ensure this is present */
    padding: var(--space-2) 0;
    border: 1px solid var(--neutral-200);
}

.dropdown-menu li {
    margin: 0;
    height: auto;
    width: 100%;
}

.dropdown-menu li a {
    color: var(--neutral-700);
    padding: var(--space-3) var(--space-4);
    height: auto;
    border-left: 3px solid transparent;
    border-bottom: none;
    font-weight: normal;
    transition: all var(--transition-fast);
}

.dropdown-menu li a:hover {
    background-color: var(--neutral-100);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    border-bottom: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

/* Footer */
footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-6) 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    text-align: center;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-6);
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--neutral-700);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--neutral-300);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    transition: border var(--transition-fast), box-shadow var(--transition-fast);
    background-color: white;
    color: var(--neutral-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(48, 77, 109, 0.15);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: var(--space-10);
}

/* Custom select dropdown styling */
.form-group select:hover {
    border-color: var(--primary-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Custom Dropdown*/
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--neutral-300);
    border-radius: var(--border-radius-md);
    background-color: white;
    color: var(--neutral-800);
    cursor: pointer;
    font-size: 1rem;
}

.custom-select::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--neutral-600);
    pointer-events: none;
}

.custom-select select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(48, 77, 109, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group .help-text {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--danger);
}

.form-group.error .error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: var(--space-2);
    display: block;
}

.form-row {
    display: flex;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.form-col {
    flex: 1;
}

.form-actions {
    margin-top: var(--space-8);
    display: flex;
    gap: var(--space-3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-fast);
    line-height: 1.4;
    height: 40px;
    min-width: 100px;
}

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

.btn svg {
    margin-right: var(--space-2);
}

/* Primary button */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-primary:active {
    background-color: var(--primary-dark);
    transform: translateY(0);
}

/* Secondary button */
.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: #34b3b1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-secondary:active {
    background-color: #2c8a88;
    transform: translateY(0);
}

/* Outline button */
.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--neutral-300);
}

.btn-outline:hover, .btn-outline:focus {
    border-color: var(--primary-color);
    background-color: rgba(48, 77, 109, 0.05);
}

.btn-outline:active {
    background-color: rgba(48, 77, 109, 0.1);
}

/* Success button */
.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover, .btn-success:focus {
    background-color: #0ea16f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-success:active {
    background-color: #0b8a5f;
    transform: translateY(0);
}

/* Danger button */
.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover, .btn-danger:focus {
    background-color: #e02d2d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-danger:active {
    background-color: #c81717;
    transform: translateY(0);
}

/* Warning button */
.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover, .btn-warning:focus {
    background-color: #ed940b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-warning:active {
    background-color: #d68b0c;
    transform: translateY(0);
}

/* Button sizes */
.btn-sm {
    height: 32px;
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    min-width: 80px;
}

.btn-lg {
    height: 48px;
    padding: var(--space-3) var(--space-8);
    font-size: 1.05rem;
    min-width: 120px;
}

/* Flash Messages - Original */
.flash-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
    display: none; /* Hide by default now that we use JS notifications */
}

.flash-messages {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.flash-message {
    padding: var(--space-4);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-4);
    position: relative;
    display: flex;
    align-items: center;
    box-shadow: var(--box-shadow-md);
    animation:
        fadeIn 0.3s ease-out forwards,
        slideDown 0.3s ease-out forwards;
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.flash-message.fade-out {
    animation:
        fadeOut 0.3s ease-out forwards,
        slideUp 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

.flash-message::before {
    content: '';
    width: 24px;
    height: 24px;
    margin-right: var(--space-3);
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.flash-error {
    background-color: var(--danger-light);
    border-left: 4px solid var(--danger);
    color: #9b1c1c;
}

.flash-error::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23E02D2D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

.flash-success {
    background-color: var(--success-light);
    border-left: 4px solid var(--success);
    color: #046c4e;
}

.flash-success::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230EA16F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.flash-info {
    background-color: var(--info-light);
    border-left: 4px solid var(--info);
    color: #1e429f;
}

.flash-info::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233B82F6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
}

.flash-warning {
    background-color: var(--warning-light);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.flash-warning::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ED940B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'%3E%3C/path%3E%3Cline x1='12' y1='9' x2='12' y2='13'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
}

.close-button {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.close-button:hover {
    opacity: 1;
}

/* JS Notifications - New unified system */
.notification {
    position: relative;
    margin-bottom: 10px;
    padding: 12px 20px;
    min-width: 280px;
    max-width: 400px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: var(--success, #28a745);
    color: white;
    border-left: 4px solid var(--success-dark, #1e7e34);
}

.notification.error {
    background-color: var(--danger, #dc3545);
    color: white;
    border-left: 4px solid var(--danger-dark, #bd2130);
}

.notification.info {
    background-color: var(--info, #17a2b8);
    color: white;
    border-left: 4px solid var(--info-dark, #117a8b);
}

.notification.warning {
    background-color: var(--warning, #ffc107);
    color: #212529;
    border-left: 4px solid var(--warning-dark, #d39e00);
}

.notification-content {
    display: flex;
    align-items: center;
    font-weight: 500;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.notification.success::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.notification.error::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

.notification.info::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
}

.notification.warning::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'%3E%3C/path%3E%3Cline x1='12' y1='9' x2='12' y2='13'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
}

/* Card Components */
.card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
}

.card-header h2, 
.card-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--neutral-800);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    background-color: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
}

/* Authentication Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: var(--space-6);
}

.auth-form {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    padding: var(--space-8);
    width: 100%;
    max-width: 450px;
}

.auth-form h2 {
    margin-bottom: var(--space-6);
    text-align: center;
    color: var(--neutral-800);
    font-weight: 600;
}

.auth-form .logo-container {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-form .logo-container img {
    max-width: 200px; /* Increased size for better visibility */
    height: auto;
}

/* Dashboard */
.dashboard-container {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
}

.dashboard-header h2 {
    margin: 0;
    font-weight: 600;
    color: var(--neutral-800);
}

.header-actions {
    display: flex;
    gap: var(--space-3);
}

.search-inline {
    width: 280px;
}

.search-inline input {
    border: 1px solid var(--neutral-300);
    border-radius: var(--border-radius-md);
    padding: var(--space-2) var(--space-4);
    font-size: 0.95rem;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px;
    padding-left: 35px;
}

.search-inline input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(48, 77, 109, 0.15);
}

.filters {
    background-color: var(--neutral-50);
    padding: var(--space-6);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    border-bottom: 1px solid var(--neutral-200);
}

.filter-group {
    min-width: 180px;
    position: relative;
    flex: 1;
}

.filter-group label {
    display: none; /* Hide labels as requested */
}

.filter-group select {
    height: 40px;
    padding-right: 30px;
    cursor: pointer;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--neutral-300);
    background-color: white;
    width: 100%;
    transition: all var(--transition-fast);
}

.filter-group select:hover {
    border-color: var(--primary-color);
}

.filter-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(48, 77, 109, 0.15);
    outline: none;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    margin-left: auto;
    gap: var(--space-3);
}

.document-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.document-grid th {
    background-color: var(--neutral-100);
    padding: var(--space-4) var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--neutral-700);
    border-bottom: 2px solid var(--neutral-300);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.document-grid td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--neutral-200);
    vertical-align: middle;
}

.document-grid tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    cursor: pointer;
}

.document-grid tr:last-child td {
    border-bottom: none;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: var(--space-2);
    position: relative;
    top: -1px;
}

.status-0 { background-color: var(--warning); } /* Pending */
.status-1 { background-color: var(--success); } /* Approved */
.status-2 { background-color: var(--danger); } /* Review Required */

.expiry-indicator {
    font-weight: 600;
    white-space: nowrap;
}

.expiry-overdue { color: var(--danger); }
.expiry-urgent { color: var(--danger); }
.expiry-warning { color: var(--warning); }
.expiry-good { color: var(--success); }

/* Compact the filter group layout */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.filter-group {
    min-width: 120px;
    flex: 0 0 auto;
}

/* Document search fields have common styles in .search-field input */

/* Ensure table columns are properly sized */
.document-grid th:nth-child(2), /* Group */
.document-grid th:nth-child(4) { /* Type */
    width: 50px;
}

/* Search field styling */
.search-field {
    position: relative;
    margin-right: var(--space-3);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--neutral-500);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    width: 20px;
    height: 20px;
}

.search-icon svg {
    width: 16px;
    height: 16px;
}

.search-field input {
    padding: 8px 12px 8px 38px;
    border: 1px solid var(--neutral-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    position: relative;
}

/* Search field widths */
.title-search input {
    width: 280px;
}

.number-search input {
    width: 150px;
    padding-left: 38px !important; /* Ensure this overrides any conflicting styles */
}

/* Toggle button styling */
.toggle-container {
    margin-left: var(--space-4);
}

.toggle-button {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--neutral-300);
}

.toggle-button.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.toggle-button.archive {
    background-color: var(--warning-light);
    border-color: var(--warning);
}

#toggleLabel {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-right: 8px;
    transition: color 0.3s ease;
}

.toggle-button.active #toggleLabel {
    color: #94c0fd; /* Light blue color for better contrast on dark background */
}

.toggle-button.archive #toggleLabel {
    color: var(--warning);
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--neutral-300);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.toggle-button.active .toggle-switch {
    background-color: var(--primary);
}

.toggle-button.archive .toggle-switch {
    background-color: var(--warning);
}

.toggle-circle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-button.archive .toggle-circle {
    transform: translateX(16px);
}

.toggle-button input {
    display: none;
}

/* Header actions layout */
.header-actions {
    display: flex;
    align-items: center;
}

.bulk-actions {
    background-color: var(--neutral-50);
    padding: var(--space-6);
    border-top: 1px solid var(--neutral-200);
}

/* Document View */
.document-container {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background-color: var(--neutral-50);
}

.document-meta {
    display: flex;
    align-items: center;
    margin-top: var(--space-2);
    color: var(--neutral-600);
}

.document-info {
    padding: var(--space-6);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: 0;
    border-bottom: 1px solid var(--neutral-200);
}

.info-group {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-weight: 600;
    color: var(--neutral-600);
    margin-bottom: var(--space-2);
    font-size: 0.9rem;
}

.info-value {
    font-size: 1.05rem;
    color: var(--neutral-800);
}

.document-references {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
}

.document-references h3 {
    color: var(--neutral-800);
    margin-bottom: var(--space-4);
    font-weight: 600;
}

.reference-section {
    margin-top: var(--space-4);
}

.reference-section h4 {
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.reference-list {
    list-style-type: none;
    padding-left: var(--space-4);
    margin-top: var(--space-3);
}

.reference-list li {
    margin-bottom: var(--space-2);
    position: relative;
}

.reference-list li::before {
    content: '•';
    position: absolute;
    left: -15px;
    color: var(--primary-color);
}

.document-actions {
    padding: var(--space-6);
    margin-top: 0;
    border-top: none;
}

.document-actions h3 {
    color: var(--neutral-800);
    margin-bottom: var(--space-4);
    font-weight: 600;
}

/* Admin Pages */
.admin-container {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background-color: var(--neutral-50);
}

.admin-header h2 {
    margin: 0;
    font-weight: 600;
    color: var(--neutral-800);
}

.admin-body {
    padding: var(--space-6);
}

.two-column-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: var(--space-6);
}

.panel {
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--neutral-200);
    height: 100%;
    overflow: hidden;
}

.panel-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background-color: var(--neutral-50);
}

.panel-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 1.1rem;
}

.panel-body {
    padding: var(--space-6);
}

/* 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);
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: var(--space-6);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    max-width: 550px;
    animation: modalFadeIn 0.3s;
}

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

.modal-content h3 {
    margin-top: 0;
    margin-bottom: var(--space-6);
    color: var(--neutral-800);
    font-weight: 600;
}

.close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--neutral-500);
    transition: color var(--transition-fast);
}

.close:hover {
    color: var(--neutral-800);
}

/* File Type Actions */
.file-type-actions {
    display: flex;
    gap: 8px;
}

.file-type-action {
    width: 34px !important;
    height: 34px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #9CA3AF !important; /* --neutral-400 */
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    outline: none !important;
    box-shadow: none !important;
}

.file-type-action:hover {
    transform: translateY(-2px);
}

.viewable-btn {
    background-color: #9CA3AF !important; /* --neutral-400 */
    color: white !important;
    transition: all 0.2s ease-in-out !important;
}

.viewable-btn.active {
    background-color: #10B981 !important; /* --success */
    color: white !important;
}

.enable-btn {
    background-color: #9CA3AF !important; /* --neutral-400 */
    color: white !important;
    transition: all 0.2s ease-in-out !important;
}

.enable-btn.active {
    background-color: #10B981 !important; /* --success */
    color: white !important;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .document-info {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: var(--space-4);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: var(--space-4);
        height: auto;
    }
    
    header {
        height: auto;
        position: relative;
    }
    
    nav {
        width: 100%;
        margin-top: var(--space-4);
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        height: 40px;
        margin: var(--space-1);
    }
    
    nav ul li a {
        padding: var(--space-2) var(--space-3);
        height: 100%;
        border-radius: var(--border-radius-md);
        border-bottom: none;
    }
    
    nav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-bottom: none;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .dashboard-header,
    .document-header,
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        margin-top: var(--space-4);
        width: 100%;
        justify-content: space-between;
    }
    
    .filters {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .filter-group {
        width: 100%;
    }
    
    .document-info {
        grid-template-columns: 1fr;
    }
    
    .document-grid {
        display: block;
        overflow-x: auto;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: var(--space-4);
    }
    
    .btn {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .content {
        padding: var(--space-4);
    }
    
    .dashboard-header h2,
    .document-header h2,
    .admin-header h2 {
        font-size: 1.25rem;
    }
    
    .card-header,
    .card-body,
    .card-footer,
    .dashboard-header,
    .document-header,
    .admin-header,
    .panel-body {
        padding: var(--space-4);
    }
    
    .auth-form {
        padding: var(--space-4);
    }
}

/* Last signed info styling */
.last-signed-info {
    margin-top: 10px; 
    padding: 12px 16px; 
    border: 1px solid var(--neutral-200); 
    border-left: 3px solid var(--signed-color);
    border-radius: 6px; 
    background-color: var(--warning-light); 
    min-height: 40px; 
    color: var(--signed-color);
    font-weight: 600; 
    text-align: left;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.last-signed-info .signed-by {
    display: block;
    font-size: 0.95rem;
}

.last-signed-info .signed-at {
    display: block;
    font-size: 0.85rem;
    color: var(--neutral-600);
}
