/**
 * DocSign - Unified Design System
 * Modern, Professional UI Framework
 */

/* ========================================
   CSS VARIABLES - Design Tokens
   ======================================== */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #a5b4fc;
    --primary-dark: #4338ca;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    /* Secondary Colors */
    --secondary: #0f172a;
    --secondary-light: #1e293b;

    /* Accent Colors */
    --accent: #fbbf24;
    --accent-light: #fde68a;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;

    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;

    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;

    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #2563eb;

    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-dark: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Border Colors */
    --border-light: #e2e8f0;
    --border-default: #cbd5e1;
    --border-focus: #6366f1;

    /* Layout */
    --sidebar-width: 70px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    --content-max-width: 1400px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.35);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;

    /* Font Family */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.875rem;
    --text-lg: 1rem;
    --text-xl: 1.125rem;
    --text-2xl: 1.375rem;
    --text-3xl: 1.75rem;

    /* 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;
}

/* ========================================
   BASE STYLES
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ========================================
   SIDEBAR - Icon Only Style
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4) 0;
    transition: width var(--transition-normal), transform var(--transition-normal);
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-2) 0 var(--space-4) 0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sidebar-logo i {
    font-size: 1.25rem;
    color: var(--text-white);
}

.sidebar-logo span {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: var(--space-4) 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
}

.sidebar-menu li {
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar-menu a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.sidebar-menu a span {
    display: none;
}

.sidebar-menu a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.sidebar-menu a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-menu a i {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: var(--space-4) 0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    font-size: var(--text-xs);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.sidebar-avatar:hover {
    transform: scale(1.05);
}

.sidebar-user-info {
    display: none;
}

.sidebar-user-name {
    display: none;
}

.sidebar-user-role {
    display: none;
}

.sidebar-logout {
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

.sidebar-logout:hover {
    color: var(--text-white);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
    background: var(--bg-secondary);
    padding: var(--space-4) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
    min-height: var(--header-height);
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0;
}

.page-title i {
    color: var(--primary);
}

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

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-size: var(--text-base);
}

.header-btn:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: var(--text-white);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Search Box */
.search-box {
    position: relative;
    width: 260px;
}

.search-box input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) 42px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--gray-50);
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--text-base);
    transition: all var(--transition-fast);
}

.mobile-toggle:hover {
    background: var(--gray-200);
    color: var(--primary);
}

/* ========================================
   CONTENT WRAPPER
   ======================================== */
.content-wrapper {
    padding: var(--space-6);
    width: 100%;
}

.content-area {
    padding: var(--space-5);
}

.page-header {
    margin-bottom: var(--space-6);
}

.page-header h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}

.page-header p,
.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-4) var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-header h5 i {
    color: var(--primary);
}

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

.card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--border-light);
    padding: var(--space-4) var(--space-5);
}

/* ========================================
   STAT CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: var(--primary);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    color: var(--success);
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
    color: var(--warning);
}

.stat-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    color: var(--info);
}

.stat-icon.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    color: var(--danger);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.stat-trend.up {
    background: var(--success-light);
    color: var(--success-dark);
}

.stat-trend.down {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.stat-trend.neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: var(--text-white);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

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

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
}

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

.btn-warning:hover {
    background: var(--warning-dark);
}

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

.btn-danger:hover {
    background: var(--danger-dark);
}

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

.btn-info:hover {
    background: var(--info-dark);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-default);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-control,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--text-sm);
    z-index: 1;
}

.input-group .form-control {
    padding-left: 42px;
}

/* Form Check / Switch */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-switch .form-check-input {
    width: 44px;
    height: 24px;
    border-radius: var(--radius-full);
    background-color: var(--gray-300);
    border: none;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
}

.form-check-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

/* ========================================
   TABLES
   ======================================== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    margin: 0;
}

.table thead th {
    background: var(--gray-50);
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.table tbody td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    color: var(--text-primary);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Status Badges */
.badge-status {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-status.created { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.badge-status.sent { background: var(--info-light); color: var(--info-dark); }
.badge-status.pending { background: var(--warning-light); color: var(--warning-dark); }
.badge-status.signed { background: var(--success-light); color: var(--success-dark); }
.badge-status.active { background: var(--success-light); color: var(--success-dark); }
.badge-status.inactive { background: var(--danger-light); color: var(--danger-dark); }

/* Role Badges */
.badge-role {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: capitalize;
}

.badge-role.administrator { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.badge-role.manager { background: var(--success-light); color: var(--success-dark); }
.badge-role.agent { background: var(--warning-light); color: var(--warning-dark); }

/* ========================================
   ACTION BUTTONS
   ======================================== */
.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    text-decoration: none;
}

.action-btn.view { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.action-btn.view:hover { background: rgba(59, 130, 246, 0.2); }

.action-btn.edit { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.action-btn.edit:hover { background: rgba(245, 158, 11, 0.2); }

.action-btn.delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.action-btn.delete:hover { background: rgba(239, 68, 68, 0.2); }

.action-btn.download { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.action-btn.download:hover { background: rgba(16, 185, 129, 0.2); }

.action-btn.perm { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.action-btn.perm:hover { background: rgba(139, 92, 246, 0.2); }

.action-btn.disabled {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}
.action-btn.disabled:hover {
    background: rgba(148, 163, 184, 0.1);
    transform: none;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.alert i {
    font-size: var(--text-lg);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger,
.alert-error {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-dark);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ========================================
   MODALS
   ======================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.modal-title i {
    color: var(--primary);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-light);
    background: var(--gray-50);
}

/* ========================================
   TABS / NAV
   ======================================== */
.nav-tabs-custom {
    display: inline-flex;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-card);
}

.nav-tabs-custom .nav-link {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-tabs-custom .nav-link.active {
    background: var(--primary-gradient);
    color: var(--text-white);
}

/* ========================================
   ACTIVITY ITEMS
   ======================================== */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--text-base);
}

.activity-icon.created { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.activity-icon.sent { background: var(--info-light); color: var(--info-dark); }
.activity-icon.signed { background: var(--success-light); color: var(--success-dark); }
.activity-icon.pending,
.activity-icon.viewed { background: var(--warning-light); color: var(--warning-dark); }
.activity-icon.deleted { background: var(--danger-light); color: var(--danger-dark); }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-description {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.activity-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

/* ========================================
   USER CELLS
   ======================================== */
.user-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-cell-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    font-size: var(--text-xs);
    flex-shrink: 0;
}

.user-cell-info h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.user-cell-info p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
}

/* ========================================
   CHARTS GRID
   ======================================== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.chart-header h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.chart-header h3 i {
    color: var(--primary);
}

.chart-container {
    position: relative;
    height: 260px;
}

/* ========================================
   VIEW ALL LINK
   ======================================== */
.view-all-btn {
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.view-all-btn:hover {
    color: var(--primary-hover);
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-info { background-color: var(--info) !important; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show,
    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .search-box {
        width: 200px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

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

    .top-header {
        padding: var(--space-3) var(--space-4);
    }

    .content-wrapper,
    .content-area {
        padding: var(--space-4);
    }

    .search-box {
        display: none;
    }

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

    .table thead th,
    .table tbody td {
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    .header-actions .btn span {
        display: none;
    }

    .btn {
        padding: var(--space-3);
    }
}

/* ========================================
   LOGIN PAGE SPECIFIC
   ======================================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    min-height: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.login-left {
    flex: 1;
    background: var(--primary-gradient);
    padding: var(--space-10) var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.login-right {
    flex: 1;
    padding: var(--space-10) var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-logo {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-logo i {
    font-size: 2rem;
    color: var(--accent);
}

.brand-logo span {
    color: var(--accent);
}

.brand-tagline {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: var(--space-8);
    max-width: 300px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, 0.95);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
}

.features-list li i {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--accent);
}

.login-header {
    margin-bottom: var(--space-6);
}

.login-header h1 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.login-header p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.forgot-link {
    font-size: var(--text-sm);
    color: var(--primary);
    font-weight: 500;
}

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

.btn-login {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
}

.company-badge {
    margin-top: auto;
    padding-top: var(--space-6);
    text-align: center;
}

.company-badge p {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.company-badge strong {
    color: var(--text-white);
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        max-width: 400px;
        min-height: auto;
    }

    .login-left {
        padding: var(--space-8) var(--space-6);
    }

    .login-right {
        padding: var(--space-8) var(--space-6);
    }

    .features-list {
        display: none;
    }

    .brand-tagline {
        margin-bottom: var(--space-4);
    }
}

/* ========================================
   SETTINGS PAGE SPECIFIC
   ======================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-5);
}

.settings-nav {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    box-shadow: var(--shadow-card);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
}

.settings-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    transition: all var(--transition-fast);
}

.settings-nav a:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.settings-nav a.active {
    background: var(--primary-gradient);
    color: var(--text-white);
}

.settings-nav a i {
    font-size: var(--text-base);
    width: 20px;
    text-align: center;
}

.settings-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.section-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-light);
}

.section-header h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-header h2 i {
    color: var(--primary);
}

.section-header p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.section-body {
    padding: var(--space-5);
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: var(--text-xl);
    font-weight: 600;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--gray-100);
}

.toggle-group:last-child {
    border-bottom: none;
}

.toggle-info h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toggle-info p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

.danger-zone {
    background: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-top: var(--space-5);
}

.danger-zone h4 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--danger);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.danger-zone p {
    font-size: var(--text-sm);
    color: #991b1b;
    margin-bottom: var(--space-4);
}

@media (max-width: 992px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2);
        position: static;
    }

    .settings-nav a {
        margin-bottom: 0;
    }
}

/* ========================================
   DOCUMENT PREVIEW
   ======================================== */
.preview-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-4);
}

.preview-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.preview-header .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

.preview-header .gap-2 {
    gap: 6px !important;
}

.preview-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.preview-header h3 i {
    color: var(--primary);
    font-size: 14px;
}

.preview-body {
    padding: var(--space-4);
    background: var(--gray-100);
    min-height: 500px;
}

.document-preview {
    background: var(--bg-secondary);
    max-width: 750px;
    margin: 0 auto;
    padding: var(--space-10);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    border: 3px solid #1e293b;
    position: relative;
    overflow: hidden;
}

/* Document Watermark - Removed */
.document-preview::before {
    content: none;
}

.document-preview > * {
    position: relative;
    z-index: 1;
}

/* Document Logo Section */
.doc-logo-section {
    text-align: center;
    margin-bottom: var(--space-6);
}

/* Logo Image */
.doc-logo-img {
    max-width: 220px;
    height: auto;
    margin: 0 auto var(--space-4);
    display: block;
}

/* Fallback icon if image not available */
.doc-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-3);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.doc-logo-icon i {
    font-size: 28px;
    color: white;
}

/* Text fallback for logo (hidden by default, shown in PDF if image fails) */
.doc-logo-text-fallback {
    display: none;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: var(--space-2);
}

.activity-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    font-size: 12px;
}

.activity-sidebar-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.activity-sidebar-header h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.activity-sidebar-header h3 i {
    color: var(--info);
    font-size: 14px;
}

.activity-trail {
    padding: var(--space-2) var(--space-3);
}

.trail-item {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.trail-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-white);
}

.trail-icon.sent { background: linear-gradient(135deg, var(--info), #2563eb); }
.trail-icon.delivered { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.trail-icon.opened { background: linear-gradient(135deg, var(--warning), var(--warning-dark)); }
.trail-icon.viewed { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.trail-icon.signed { background: linear-gradient(135deg, var(--success), var(--success-dark)); }
.trail-icon.pending { background: linear-gradient(135deg, var(--gray-400), var(--gray-500)); }

.trail-content {
    flex: 1;
}

.trail-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.trail-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.trail-details {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

.signature-box {
    margin: var(--space-2) var(--space-3);
    padding: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-light);
}

.signature-box h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.signature-img {
    max-width: 100%;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.sig-details {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: var(--space-2);
    line-height: 1.5;
}

.action-buttons {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border-light);
}

.action-buttons .btn {
    width: 100%;
    margin-bottom: var(--space-2);
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
}

.action-buttons .btn:last-child {
    margin-bottom: 0;
}

/* New Sidebar Design - Compact */
.sidebar-status-section {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.completed {
    background: #10b981;
    color: white;
}

.status-badge.sent {
    background: #3b82f6;
    color: white;
}

.status-badge.pending {
    background: #6b7280;
    color: white;
}

.status-message {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.sidebar-actions-list {
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.action-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

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

.action-link i {
    width: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-info-grid {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.sidebar-info-grid .info-item {
    display: flex;
    flex-direction: column;
}

.sidebar-info-grid .info-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.sidebar-info-grid .info-value {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
}

.sidebar-recipients {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.recipients-title {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: var(--space-2);
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipient-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.recipient-info {
    flex: 1;
}

.recipient-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.signed-badge {
    font-size: 9px;
    color: #10b981;
    font-weight: 600;
}

.recipient-email {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
}

.sidebar-signature {
    padding: var(--space-3) var(--space-4);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-signature .signature-img {
    max-width: 150px;
    max-height: 50px;
    margin-bottom: 4px;
}

.sidebar-signature .signature-label {
    font-size: 9px;
    color: var(--text-muted);
    font-style: italic;
}

.sidebar-action-buttons {
    padding: var(--space-3) var(--space-4);
}

.sidebar-action-buttons .btn {
    width: 100%;
    margin-bottom: var(--space-2);
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
}

.sidebar-action-buttons .btn:last-child {
    margin-bottom: 0;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Audit Trail Modal */
.audit-trail-list {
    max-height: 400px;
    overflow-y: auto;
}

.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.audit-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    flex-shrink: 0;
}

.audit-icon.created { background: #6366f1; }
.audit-icon.sent { background: #3b82f6; }
.audit-icon.opened { background: #f59e0b; }
.audit-icon.signed { background: #10b981; }

.audit-content {
    flex: 1;
}

.audit-content strong {
    display: block;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 1px;
}

.audit-content span {
    font-size: 10px;
    color: var(--text-muted);
}

.audit-content small {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dark theme for new sidebar */
body.dark-theme .sidebar-status-section,
body.dark-theme .sidebar-actions-list,
body.dark-theme .sidebar-info-grid,
body.dark-theme .sidebar-recipients,
body.dark-theme .sidebar-signature,
body.dark-theme .sidebar-action-buttons {
    border-color: #334155;
}

body.dark-theme .action-link:hover {
    color: #818cf8;
}

body.dark-theme .recipient-avatar {
    background: linear-gradient(135deg, #f97316, #c2410c);
}

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

    .activity-sidebar {
        margin-top: var(--space-5);
    }
}

/* ========================================
   FORM PANELS
   ======================================== */
.form-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.form-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
}

.form-header h3 {
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.form-header h3 i {
    color: var(--primary);
}

.form-body {
    padding: var(--space-5);
}

.form-section {
    margin-bottom: var(--space-6);
}

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

.form-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Create Layout */
.create-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-6);
    height: calc(100vh - var(--header-height) - var(--space-10));
}

@media (max-width: 1200px) {
    .create-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .create-layout .preview-panel {
        display: none;
    }
}

/* Permission Items */
.perm-section {
    margin-bottom: var(--space-5);
}

.perm-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.perm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.perm-info h5 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.perm-info p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

/* ========================================
   DOCUMENT STYLES
   ======================================== */
.doc-company {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.doc-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-5);
    text-align: center;
    padding-bottom: var(--space-4);
    border-bottom: 2px solid #e2e8f0;
}

.doc-info-box,
.doc-vehicle-box {
    background: #f8fafc;
    padding: var(--space-4);
    border-radius: 0;
    margin-bottom: var(--space-3);
    border: 1px solid #e2e8f0;
}

.doc-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: var(--text-sm);
}

.doc-info-row:last-child {
    margin-bottom: 0;
}

.doc-info-label {
    font-weight: 700;
    width: 130px;
    color: #1e293b;
}

.doc-info-value {
    color: #9a3412;
    font-weight: 400;
    text-align: right;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    border: 1px solid #e2e8f0;
}

.doc-table th {
    background: #f1f5f9;
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border: 1px solid #e2e8f0;
    font-weight: 700;
    color: #1e293b;
}

.doc-table td {
    padding: var(--space-3) var(--space-4);
    border: 1px solid #e2e8f0;
}

.doc-table .highlight {
    background: transparent;
    color: #1e293b;
    font-weight: 400;
    text-align: right;
}

.doc-table .amount {
    text-align: right;
}

.doc-table .total-row {
    font-weight: 700;
    background: #f1f5f9;
}

.doc-table .total-row td {
    font-weight: 700;
}

.doc-terms {
    margin-top: var(--space-5);
}

.doc-terms h4 {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.doc-terms ol {
    font-size: var(--text-xs);
    color: #475569;
    padding-left: var(--space-5);
    line-height: 1.7;
    margin: 0;
}

.doc-terms li {
    margin-bottom: var(--space-2);
}

.doc-note {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-5);
    line-height: 1.6;
}

.doc-contact {
    font-size: var(--text-sm);
    margin-top: var(--space-5);
}

/* ========================================
   MODERN DASHBOARD STYLES
   ======================================== */

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-6);
    align-items: start;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-8);
    color: var(--text-white);
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: 5%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.welcome-banner h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-4);
    max-width: 500px;
    position: relative;
    z-index: 1;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.welcome-banner .banner-stats {
    display: flex;
    gap: var(--space-6);
    position: relative;
    z-index: 1;
}

.welcome-banner .banner-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.welcome-banner .banner-stat i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.welcome-banner .banner-stat span {
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Quick Stats Row */
.quick-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.quick-stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    cursor: pointer;
    min-width: 0;
}

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

.quick-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.quick-stat-icon.purple {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--text-white);
}

.quick-stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--text-white);
}

.quick-stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--text-white);
}

.quick-stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-white);
}

.quick-stat-content {
    flex: 1;
    min-width: 0;
}

.quick-stat-content h4 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px 0;
    line-height: 1;
}

.quick-stat-content p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
}

.quick-stat-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text-white);
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Device Cards Grid */
.device-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.device-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

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

.device-card.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--text-white);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.device-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.device-card:not(.active) .device-card-icon {
    background: var(--gray-100);
    color: var(--primary);
}

.device-card.active .device-card-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
}

.device-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin: 0;
}

.device-card-value {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: var(--space-2) 0 0 0;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.widget-header h3 {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.widget-header .widget-action {
    font-size: var(--text-xs);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* My Devices Widget */
.my-devices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.mini-device-card {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.mini-device-card.purple {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--text-white);
}

.mini-device-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--text-white);
}

.mini-device-card.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--text-white);
}

.mini-device-card.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-white);
}

.mini-device-card i {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
    display: block;
}

.mini-device-card span {
    font-size: var(--text-xs);
    font-weight: 500;
    display: block;
}

.mini-device-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: 10px;
    opacity: 0.9;
}

/* Members/Team Widget */
.members-list {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.member-avatar {
    text-align: center;
}

.member-avatar img,
.member-avatar .avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin-bottom: var(--space-1);
}

.member-avatar .avatar-placeholder {
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    font-size: var(--text-sm);
}

.member-avatar span {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
}

.member-avatar small {
    font-size: 9px;
    color: var(--text-muted);
    display: block;
}

/* Progress/Chart Widget */
.progress-chart {
    height: 120px;
    position: relative;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
}

.progress-legend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.progress-legend::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.progress-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

/* Circular Progress */
.circular-progress {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    position: relative;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 12;
}

.circular-progress .bg {
    stroke: var(--gray-100);
}

.circular-progress .progress {
    stroke: url(#gradient);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.circular-progress .center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.circular-progress .center-text .value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.circular-progress .center-text .label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* Temperature/Gauge Controls */
.gauge-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.gauge-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gray-100);
    color: var(--text-secondary);
    font-size: var(--text-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-btn:hover {
    background: var(--primary);
    color: var(--text-white);
}

.gauge-btn.primary {
    background: var(--primary);
    color: var(--text-white);
}

/* Room Selector */
.room-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.room-selector select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.room-selector select:focus {
    outline: none;
}

.room-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.room-info span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* Dashboard Responsive */
@media (max-width: 1400px) {
    .dashboard-layout {
        grid-template-columns: 1fr 300px;
    }
}

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

    .dashboard-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-5);
        position: static;
    }
}

@media (max-width: 1100px) {
    .quick-stats-row:not(.full-width) {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .quick-stats-row:not(.full-width) {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        grid-template-columns: 1fr;
    }

    .device-cards-grid {
        grid-template-columns: 1fr;
    }

    .my-devices-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .welcome-banner {
        padding: var(--space-5);
    }

    .content-wrapper {
        padding: var(--space-4);
    }
}

/* ========================================
   DARK THEME
   ======================================== */
body.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-light: #334155;
    --border-default: #475569;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .sidebar {
    background: #0f172a;
    border-right-color: #334155;
}

body.dark-theme .top-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark-theme .card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .card-header {
    border-bottom-color: #334155;
}

body.dark-theme .table thead th {
    background: #0f172a;
    border-bottom-color: #334155;
    color: #94a3b8;
}

body.dark-theme .table tbody td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

body.dark-theme .table tbody tr:hover {
    background: #334155;
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    background-color: #1e293b;
    border-color: var(--primary);
}

body.dark-theme .form-control::placeholder {
    color: #64748b;
}

body.dark-theme .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

body.dark-theme .btn-secondary:hover {
    background: #475569;
}

body.dark-theme .settings-nav {
    background: #1e293b;
}

body.dark-theme .settings-nav a {
    color: #94a3b8;
}

body.dark-theme .settings-nav a:hover {
    background: #334155;
    color: #f1f5f9;
}

body.dark-theme .settings-content {
    background: #1e293b;
}

body.dark-theme .section-header {
    border-bottom-color: #334155;
}

body.dark-theme .toggle-group {
    border-bottom-color: #334155;
}

body.dark-theme .danger-zone {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

body.dark-theme .danger-zone p {
    color: #fca5a5;
}

body.dark-theme .quick-stat-card {
    background: #1e293b;
}

body.dark-theme .sidebar-widget {
    background: #1e293b;
}

body.dark-theme .modal-content {
    background: #1e293b;
    color: #f1f5f9;
}

body.dark-theme .modal-header {
    border-bottom-color: #334155;
}

body.dark-theme .modal-footer {
    border-top-color: #334155;
    background: #0f172a;
}

body.dark-theme .btn-close {
    filter: invert(1);
}

body.dark-theme .alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

body.dark-theme .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

body.dark-theme .nav-tabs-custom {
    background: #1e293b;
}

body.dark-theme .nav-tabs-custom .nav-link {
    color: #94a3b8;
}

body.dark-theme .nav-tabs-custom .nav-link:hover {
    background: #334155;
    color: #f1f5f9;
}

body.dark-theme .activity-item {
    border-bottom-color: #334155;
}

body.dark-theme .welcome-banner h2,
body.dark-theme .welcome-banner p {
    color: #ffffff;
}

body.dark-theme input:disabled,
body.dark-theme .form-control:disabled {
    background-color: #334155;
    color: #64748b;
}

/* ========================================
   TEMPLATE INFO BANNER
   ======================================== */
.template-info-banner {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--primary);
}

.template-info-banner .template-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.template-info-banner .template-icon.purple {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--text-white);
}

.template-info-banner .template-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--text-white);
}

.template-info-banner .template-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-white);
}

.template-info-banner .template-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--text-white);
}

body.dark-theme .template-info-banner {
    background: #1e293b;
}

/* Dark theme for document preview */
body.dark-theme .doc-info-box,
body.dark-theme .doc-vehicle-box {
    background: #0f172a;
    border-color: #334155;
}

body.dark-theme .doc-info-label {
    color: #cbd5e1;
}

body.dark-theme .doc-info-value {
    color: #fb923c;
}

body.dark-theme .doc-table {
    border-color: #334155;
}

body.dark-theme .doc-table th {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-theme .doc-table td {
    border-color: #334155;
}

body.dark-theme .doc-table .highlight {
    color: #e2e8f0;
}

body.dark-theme .doc-table .total-row {
    background: #0f172a;
}

body.dark-theme .doc-terms h4 {
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-theme .doc-terms ol {
    color: #94a3b8;
}

body.dark-theme .document-preview {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .document-preview::before {
    content: none;
}

body.dark-theme .doc-logo-icon {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

body.dark-theme .preview-body {
    background: #0f172a;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    /* Hide non-essential elements */
    .sidebar,
    .activity-sidebar,
    .top-header,
    .nav-tabs-custom,
    .preview-header,
    .sidebar-status-section,
    .sidebar-actions-list,
    .sidebar-info-grid,
    .sidebar-recipients,
    .sidebar-signature,
    .sidebar-action-buttons,
    .no-print {
        display: none !important;
    }

    /* Reset body and main content */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    /* Preview layout - full width */
    .preview-layout {
        display: block !important;
        grid-template-columns: none !important;
    }

    .preview-panel {
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 100% !important;
    }

    .preview-body {
        padding: 0 !important;
        background: white !important;
    }

    /* Document preview */
    .document-preview {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 20px !important;
        max-width: 100% !important;
        background: white !important;
    }

    /* Info boxes */
    .doc-info-box,
    .doc-vehicle-box {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .doc-info-value {
        color: #9a3412 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Table styling for print */
    .doc-table {
        border: 1px solid #e2e8f0 !important;
    }

    .doc-table th,
    .doc-table td {
        border: 1px solid #e2e8f0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .doc-table th {
        background: #f3f4f6 !important;
    }

    .doc-table .total-row td {
        background: #f3f4f6 !important;
        border-top: 2px solid #374151 !important;
    }

    .doc-table .highlight {
        color: #9a3412 !important;
    }

    /* Terms & Conditions - Compact */
    .doc-terms {
        page-break-inside: avoid;
        margin-top: 10px !important;
        padding-top: 10px !important;
    }

    .doc-terms h4 {
        font-size: 11px !important;
        margin-bottom: 8px !important;
    }

    .doc-terms ol {
        font-size: 8px !important;
        line-height: 1.4 !important;
        padding-left: 15px !important;
    }

    .doc-terms li {
        margin-bottom: 3px !important;
        page-break-inside: avoid;
    }

    .doc-note {
        font-size: 8px !important;
        padding: 8px !important;
        margin-top: 8px !important;
    }

    .doc-contact {
        font-size: 8px !important;
        padding: 8px !important;
        margin-top: 8px !important;
    }

    /* Document header compact */
    .doc-company {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .doc-title {
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }

    /* Info boxes compact */
    .doc-info-box,
    .doc-vehicle-box {
        padding: 8px 10px !important;
        margin-bottom: 8px !important;
    }

    .doc-info-row {
        font-size: 10px !important;
        margin-bottom: 3px !important;
    }

    /* Table compact */
    .doc-table {
        font-size: 9px !important;
        margin-bottom: 10px !important;
    }

    .doc-table th,
    .doc-table td {
        padding: 5px 8px !important;
    }

    /* Certificate section - Compact for 1 page */
    .signing-certificate {
        page-break-inside: avoid;
        background: white !important;
        margin-top: 15px !important;
        border: 2px solid #1e3a5f !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }

    .signing-certificate::before {
        display: none !important;
    }

    .certificate-header {
        background: #1e3a5f !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        padding: 10px 12px 8px !important;
        border-radius: 10px 10px 0 0 !important;
    }

    .certificate-header .certificate-logo {
        background: #10b981 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
        margin-bottom: 5px !important;
    }

    .certificate-header h2 {
        font-size: 14px !important;
    }

    .certificate-header p {
        font-size: 8px !important;
    }

    .certificate-intro {
        padding: 6px 12px !important;
        background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .certificate-intro p {
        font-size: 8px !important;
        color: #065f46 !important;
    }

    .certificate-body {
        background: #f8fafc !important;
        padding: 10px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .certificate-section {
        padding: 8px 10px !important;
        background: white !important;
        border-radius: 6px !important;
        margin-bottom: 6px !important;
        border: 1px solid #e2e8f0 !important;
    }

    .certificate-section h4 {
        font-size: 7px !important;
        margin-bottom: 6px !important;
        padding-bottom: 4px !important;
    }

    .certificate-section .cert-row {
        font-size: 8px !important;
        margin-bottom: 3px !important;
        padding: 1px 0 !important;
    }

    .signature-section-cert {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        padding: 8px 10px !important;
        margin: 0 10px 10px !important;
        border: 2px dashed #cbd5e1 !important;
        border-radius: 8px !important;
    }

    .signature-display {
        padding: 5px !important;
    }

    .signature-display img {
        max-width: 150px !important;
        max-height: 40px !important;
    }

    .signature-display .signature-line {
        width: 150px !important;
    }

    .signature-display .signature-name {
        font-size: 10px !important;
    }

    .signature-display .signature-date {
        font-size: 7px !important;
    }

    .certificate-footer {
        padding: 8px 12px !important;
        background: #1e3a5f !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border-radius: 0 0 10px 10px !important;
    }

    .certificate-seal {
        background: #f59e0b !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
        margin-bottom: 5px !important;
    }

    .certificate-verification {
        padding: 4px 8px !important;
        margin-bottom: 5px !important;
        background: rgba(255,255,255,0.1) !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
        border-radius: 4px !important;
    }

    .certificate-verification .verification-id,
    .certificate-verification .verification-hash {
        font-size: 6px !important;
        color: rgba(255,255,255,0.9) !important;
    }

    .certificate-legal p {
        font-size: 6px !important;
        color: rgba(255,255,255,0.7) !important;
    }

    .certificate-company {
        padding-top: 5px !important;
    }

    .certificate-company strong {
        font-size: 9px !important;
        color: white !important;
    }

    .certificate-company span {
        font-size: 7px !important;
        color: rgba(255,255,255,0.7) !important;
    }

    /* Signature area */
    .signature-area {
        page-break-inside: avoid;
    }

    /* Page settings */
    @page {
        size: A4;
        margin: 10mm;
    }

    /* Avoid page breaks inside elements */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* Certificate Styles - Compact Professional Design */
.signing-certificate {
    margin-top: 30px;
    padding: 0;
    border: 2px solid #1e3a5f;
    border-radius: 12px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(30, 58, 95, 0.15);
}

.signing-certificate::before {
    display: none;
}

.certificate-header {
    text-align: center;
    padding: 15px 20px 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

.certificate-header .certificate-logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
    color: white;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.certificate-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.certificate-header p {
    font-size: 10px;
    color: rgba(255,255,255,0.85);
    margin: 0;
    letter-spacing: 0.5px;
}

.certificate-intro {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 1px solid #d1fae5;
    text-align: center;
}

.certificate-intro p {
    font-size: 9px;
    color: #065f46;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.certificate-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
    background: #f8fafc;
}

.certificate-section {
    padding: 12px 15px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    margin: 6px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.certificate-section:nth-child(even) {
    margin-left: 3px;
}

.certificate-section:nth-child(odd) {
    margin-right: 3px;
}

.certificate-section h4 {
    font-size: 9px;
    font-weight: 700;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.certificate-section h4 i {
    color: #10b981;
    font-size: 11px;
}

.certificate-section .cert-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 9px;
    padding: 3px 0;
    border-bottom: 1px dotted #e2e8f0;
}

.certificate-section .cert-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.certificate-section .cert-label {
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.certificate-section .cert-value {
    color: #1e293b;
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    max-width: 58%;
}

.certificate-section .cert-value.status-complete {
    color: #10b981;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 8px;
}

.certificate-section .cert-value.status-complete i {
    margin-right: 3px;
    font-size: 8px;
}

/* Signature Section in Certificate */
.signature-section-cert {
    grid-column: 1 / -1;
    border: none !important;
    text-align: center;
    background: white;
    padding: 12px 15px !important;
    margin: 6px !important;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.signature-display {
    padding: 10px;
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.signature-display img {
    max-width: 200px;
    max-height: 60px;
    margin-bottom: 5px;
}

.signature-display .signature-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1e3a5f, transparent);
    margin: 0 auto 8px;
}

.signature-display .signature-name {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 2px;
}

.signature-display .signature-date {
    font-size: 9px;
    color: #64748b;
}

/* Certificate Footer */
.certificate-footer {
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: 0 0 10px 10px;
    text-align: center;
}

.certificate-seal {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 18px;
    color: white;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.certificate-verification {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 8px 15px;
    margin-bottom: 10px;
    display: inline-block;
}

.certificate-verification .verification-id,
.certificate-verification .verification-hash {
    font-size: 7px;
    color: rgba(255,255,255,0.8);
    font-family: 'Courier New', monospace;
    margin-bottom: 3px;
}

.certificate-verification .verification-hash {
    margin-bottom: 0;
}

.certificate-verification strong {
    color: #10b981;
}

.certificate-legal {
    margin-bottom: 10px;
}

.certificate-legal p {
    font-size: 7px;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    margin: 0 auto;
    max-width: 500px;
}

.certificate-company {
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.certificate-company strong {
    font-size: 11px;
    color: white;
    display: block;
    margin-bottom: 2px;
}

.certificate-company span {
    font-size: 8px;
    color: rgba(255,255,255,0.6);
}

/* ========================================
   CERTIFICATE OF ACCEPTANCE - Professional Design
   ======================================== */
.certificate-acceptance {
    margin-top: 25px;
    page-break-inside: avoid;
}

.cert-border-frame {
    border: 3px solid #2563eb;
    border-radius: 8px;
    padding: 30px 35px;
    background: white;
}

.cert-logo-section {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.cert-logo-img {
    max-width: 180px;
    height: auto;
    margin-bottom: 8px;
}

.cert-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 8px;
    margin-bottom: 8px;
}

.cert-logo-icon i {
    font-size: 24px;
    color: white;
}

.cert-logo-text {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 1px;
}

.cert-main-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 15px 0;
    letter-spacing: 1px;
}

.cert-verification-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 8px;
    padding: 12px 20px;
    margin: 0 auto 20px;
    max-width: 400px;
}

.cert-verification-badge i {
    font-size: 18px;
    color: #059669;
}

.cert-verification-label {
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
}

.cert-verification-code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #047857;
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.cert-detail-highlight {
    background: #f0fdf4;
    margin: 0 -10px;
    padding: 8px 10px !important;
    border-radius: 4px;
}

.cert-detail-mono {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #047857;
}

.cert-multi-signer-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 20px;
    padding: 8px 16px;
    margin: 0 auto 20px;
    max-width: 150px;
    font-size: 13px;
    font-weight: 600;
    color: #1d4ed8;
}

.cert-multi-signer-badge i {
    font-size: 14px;
}

.cert-signer-number {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.cert-signer-name {
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.cert-intro-text {
    text-align: center;
    font-size: 13px;
    color: #4b5563;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.cert-intro-text strong {
    color: #1f2937;
}

.cert-signature-container {
    text-align: center;
    padding: 25px 40px;
    margin: 0 auto 25px;
    max-width: 400px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fafafa;
}

.cert-signature-image {
    max-width: 280px;
    max-height: 80px;
    display: block;
    margin: 0 auto;
}

.cert-details-section {
    margin-bottom: 20px;
}

.cert-details-qr-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.cert-qr-section {
    flex-shrink: 0;
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.cert-qr-code {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.cert-qr-code img {
    border-radius: 4px;
}

.cert-qr-label {
    font-size: 10px;
    color: #64748b;
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
}

.cert-detail-row:last-child {
    border-bottom: none;
}

.cert-detail-label {
    font-weight: 600;
    color: #374151;
    width: 140px;
    flex-shrink: 0;
}

.cert-detail-value {
    color: #4b5563;
    word-break: break-word;
}

.cert-separator {
    border-top: 2px dashed #d1d5db;
    margin: 20px 0;
}

.cert-legal-paragraph {
    font-size: 11px;
    color: #4b5563;
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

.cert-legal-paragraph strong {
    color: #1f2937;
}

/* ========================================
   PDF MODE - Compact Styles for PDF Export
   ======================================== */
.pdf-mode {
    padding: 15px !important;
    max-width: 100% !important;
    font-size: 11px !important;
}

.pdf-mode .doc-company {
    font-size: 16px !important;
    margin-bottom: 4px !important;
    text-align: center !important;
}

.pdf-mode .doc-title {
    font-size: 13px !important;
    margin-bottom: 12px !important;
    text-align: center !important;
}

.pdf-mode .doc-logo-section {
    margin-bottom: 12px !important;
}

.pdf-mode .doc-logo-img {
    max-width: 160px !important;
    margin-bottom: 5px !important;
}

/* Show text fallback in PDF mode as backup */
.pdf-mode .doc-logo-text-fallback {
    display: block !important;
    font-size: 18px !important;
    margin-bottom: 8px !important;
}

.pdf-mode .doc-logo-icon {
    width: 45px !important;
    height: 45px !important;
    margin-bottom: 8px !important;
}

.pdf-mode .doc-logo-icon i {
    font-size: 20px !important;
}

.pdf-mode.document-preview {
    border: none !important;
}

.pdf-mode.document-preview::before {
    content: none !important;
}

.pdf-mode .doc-info-box,
.pdf-mode .doc-vehicle-box {
    padding: 8px 12px !important;
    margin-bottom: 10px !important;
    border: none !important;
}

.pdf-mode .doc-info-row {
    font-size: 10px !important;
    margin-bottom: 4px !important;
    display: flex !important;
    justify-content: space-between !important;
}

.pdf-mode .doc-info-value {
    text-align: right !important;
}

.pdf-mode .doc-table {
    font-size: 10px !important;
    margin-bottom: 12px !important;
    border: none !important;
}

.pdf-mode .doc-table th,
.pdf-mode .doc-table td {
    padding: 6px 10px !important;
    border: none !important;
}

.pdf-mode .doc-terms {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.pdf-mode .doc-terms h4 {
    font-size: 11px !important;
    margin-bottom: 8px !important;
}

.pdf-mode .doc-terms ol {
    font-size: 9px !important;
    line-height: 1.4 !important;
}

.pdf-mode .doc-terms li {
    margin-bottom: 4px !important;
}

.pdf-mode .doc-note,
.pdf-mode .doc-contact {
    font-size: 9px !important;
    padding: 8px !important;
    margin-top: 8px !important;
}

/* Certificate PDF Mode Styles */
.pdf-mode .certificate-acceptance {
    margin-top: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-mode .cert-border-frame {
    padding: 20px 25px !important;
    border: none !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: visible !important;
}

.pdf-mode .cert-logo-img {
    max-width: 140px !important;
    height: auto !important;
    margin-bottom: 5px !important;
}

.pdf-mode .cert-logo-icon {
    width: 40px !important;
    height: 40px !important;
}

.pdf-mode .cert-logo-icon i {
    font-size: 20px !important;
}

.pdf-mode .cert-logo-text {
    font-size: 12px !important;
}

.pdf-mode .cert-main-title {
    font-size: 18px !important;
    margin-bottom: 12px !important;
}

.pdf-mode .cert-intro-text {
    font-size: 11px !important;
    margin-bottom: 20px !important;
}

.pdf-mode .cert-signature-container {
    padding: 20px 30px !important;
    margin-bottom: 20px !important;
}

.pdf-mode .cert-signature-image {
    max-width: 220px !important;
    max-height: 60px !important;
}

.pdf-mode .cert-detail-row {
    font-size: 10px !important;
    padding: 6px 0 !important;
}

.pdf-mode .cert-detail-label {
    width: 120px !important;
}

.pdf-mode .cert-separator {
    margin: 12px 0 !important;
}

.pdf-mode .cert-legal-paragraph {
    font-size: 9px !important;
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
    background: #f8fafc !important;
    border-radius: 4px !important;
}

.pdf-mode .cert-details-qr-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    align-items: flex-start !important;
}

.pdf-mode .cert-details-section {
    flex: 1 !important;
    min-width: 0 !important;
}

.pdf-mode .cert-qr-section {
    padding: 8px !important;
    flex-shrink: 0 !important;
    width: 90px !important;
}

.pdf-mode .cert-qr-code {
    width: 60px !important;
    height: 60px !important;
}

.pdf-mode .cert-qr-code img,
.pdf-mode .cert-qr-code canvas {
    width: 60px !important;
    height: 60px !important;
}

.pdf-mode .cert-qr-label {
    font-size: 7px !important;
    margin-top: 4px !important;
}

/* Document Integrity Section */
.cert-integrity-section {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 8px;
    text-align: center;
}

.cert-integrity-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.cert-integrity-header i {
    font-size: 14px;
    color: #10b981;
}

.cert-hash-display {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 10px 15px;
    border-radius: 4px;
    word-break: break-all;
    line-height: 1.4;
}

.cert-integrity-note {
    margin-top: 10px;
    font-size: 10px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cert-integrity-note i {
    color: #3b82f6;
}

.pdf-mode .cert-integrity-section {
    padding: 10px !important;
}

.pdf-mode .cert-hash-display {
    font-size: 8px !important;
    padding: 8px 10px !important;
}

.pdf-mode .cert-integrity-header {
    font-size: 9px !important;
}

.pdf-mode .cert-integrity-note {
    font-size: 8px !important;
}
