:root {
    --bg-dark: #090f1a;
    --bg-header: #0f1522;
    --card-bg: #121a2b;
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --accent-blue: #38bdf8;
    --accent-blue-hover: #0284c7;
    --accent-red: #f43f5e;
    --border-color: rgba(255, 255, 255, 0.05);
    --icon-bg: #192a40;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation */
.top-nav {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-circle {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-weight: 800;
    font-size: 14px;
}

.nav-titles { display: flex; flex-direction: column; }
.nav-titles .main-title { color: var(--accent-blue); font-weight: 700; font-size: 1rem; margin: 0; }
.nav-titles .sub-title { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

.nav-right { display: flex; gap: 1rem; }
.btn-outline {
    background: transparent; border: 1px solid var(--border-color);
    padding: 0.5rem 1rem; border-radius: 6px; font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-portal { color: var(--accent-blue); border-color: rgba(56, 189, 248, 0.3); background-color: rgba(56, 189, 248, 0.05); }
.btn-portal:hover { background-color: rgba(56, 189, 248, 0.1); }
.btn-logout { color: var(--accent-red); border-color: rgba(244, 63, 94, 0.3); background-color: rgba(244, 63, 94, 0.05); }
.btn-logout:hover { background-color: rgba(244, 63, 94, 0.1); }

/* Main Layout */
.dashboard-layout {
    display: flex;
    flex-grow: 1;
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
}

.top-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;
    flex-wrap: wrap; gap: 15px;
}
.page-title { margin: 0; color: var(--text-main); font-size: 1.8rem; }
.page-subtitle { margin: 5px 0 0; color: var(--text-muted); }

.shadow-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: bold; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-approved { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-rejected { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

.btn { padding: 0.6rem 1.2rem; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; color: white; transition: 0.2s; }
.btn-primary { background: var(--accent-blue); color: #000; }
.btn-primary:hover { background: var(--accent-blue-hover); color: white; }
.btn-success { background: var(--success); }
.btn-danger { background: var(--accent-red); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { width: 95%; max-width: 1200px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.close-btn:hover { color: white; }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }

/* Card Grid Layout - Aligned & Uniform */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

.card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.card-title {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

.card-body {
    flex: 1;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-info-label {
    color: var(--text-muted);
}

.card-info-value {
    color: var(--text-main);
    font-weight: 500;
    text-align: right;
}

.card-action {
    margin-top: auto;
}

.filter-btn.active { background: var(--accent-blue); color: #000; border-color: var(--accent-blue); }

.filter-btn {
    color: var(--text-muted);
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}
.filter-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.08);
}

/* UI Form Styles injected from common.html */

        /* Distributor Form Styles */
        .dist-form-container {
            padding: 25px;
            color: white;
            font-family: inherit;
        }

        .dist-section {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 25px;
        }

        .dist-section-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: #00d2ff;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .dist-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .dist-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .dist-label {
            display: block;
            margin-bottom: 5px;
            font-size: 12px;
            color: #9bb1c8;
            font-weight: 500;
        }

        .mandatory-star::after {
            content: " *";
            color: #ff4d4d;
        }

        .dist-input,
        .dist-select,
        .dist-textarea {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 12px 15px;
            color: white;
            font-family: inherit;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }

        .dist-input:focus,
        .dist-select:focus,
        .dist-textarea:focus {
            outline: none;
            border-color: #00d2ff;
            background: rgba(0, 0, 0, 0.4);
        }

        .dist-select {
            width: 100%;
            padding: 10px 15px;
            border-radius: 8px;
            border: 1px solid #334455;
            background: #1a2530;
            color: #fff;
            font-size: 14px;
            box-sizing: border-box;
            -webkit-box-decoration-break: clone;
            box-decoration-break: clone;

            appearance: none;
            transition: all 0.3s ease;
        }

        .dist-select option {
            background-color: #1a2530;
            color: #fff;
        }

        .photo-upload-box {
            border: 1px dashed #00d2ff;
            background: rgba(0, 210, 255, 0.05);
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            color: #9bb1c8;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .photo-upload-box:hover {
            background: rgba(0, 210, 255, 0.1);
            border-color: #4caf50;
        }

        .photo-upload-text {
            font-size: 13px;
            margin-top: 8px;
        }

        .dist-file-upload {
            background: rgba(0, 210, 255, 0.1);
            border: 1px dashed #00d2ff;
            padding: 15px;
            border-radius: 8px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .dist-file-upload:hover {
            background: rgba(0, 210, 255, 0.2);
        }

        .dist-file-upload input[type="file"] {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
        }

        .dist-table-wrapper {
            overflow-x: auto;
            margin-bottom: 15px;
        }

        .dist-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 600px;
        }

        .dist-table th,
        .dist-table td {
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 12px;
            text-align: left;
        }

        .dist-table th {
            background: rgba(255, 255, 255, 0.05);
            font-weight: 500;
            color: #00d2ff;
            font-size: 0.9rem;
        }

        .dist-table td .dist-input {
            width: 100%;
            border: none;
            background: transparent;
            padding: 8px;
            border-radius: 4px;
        }

        .dist-table td .dist-input:focus {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid #00d2ff;
        }

        .dist-btn-outline {
            background: transparent;
            border: 1px solid #00d2ff;
            color: #00d2ff;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.9rem;
        }

        .dist-btn-outline:hover {
            background: rgba(0, 210, 255, 0.1);
        }

        .dist-btn-remove {
            color: #ff4757;
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 5px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .dist-btn-remove:hover {
            background: rgba(255, 71, 87, 0.1);
        }

        .dist-terms-box {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 20px;
            height: 200px;
            overflow-y: auto;
            margin-bottom: 20px;
            font-size: 0.9rem;
            line-height: 1.6;
            color: rgba(255, 255, 255, 0.8);
        }

        .dist-terms-box ol {
            margin: 0;
            padding-left: 20px;
        }

        .dist-terms-box li {
            margin-bottom: 12px;
        }

        .dist-checkbox-group {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        .dist-checkbox-group input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .dist-submit-btn {
            background: linear-gradient(135deg, #00d2ff, #3a7bd5);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .dist-submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(0, 210, 255, 0.3);
        }

        .dist-radio-group {
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
        }

        .dist-radio-label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 0.95rem;
            color: rgba(255, 255, 255, 0.9);
        }

        .dist-radio-label input[type="radio"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
