/* 1. GLOBAL VARIABLES */
:root {
    --primary: #008f95;
    --primary-dark: #00666b;
    --primary-light: #e5f5f5;

    --background: #f4f7f8;
    --surface: #ffffff;

    --text: #263238;
    --text-muted: #718096;
    --border: #e2e8ec;

    --success: #16845b;
    --success-bg: #e6f6ef;

    --warning: #b7791f;
    --warning-bg: #fff4d6;

    --danger: #c53030;
    --danger-bg: #fee2e2;

    --sidebar-width: 245px;
    --radius: 10px;
    --shadow: 0 4px 14px rgba(31, 65, 70, 0.07);

    --font-family: Arial, Helvetica, sans-serif;
}

/* 2. GLOBAL RESET */
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    color: var(--text);
    background: var(--background);
    font-size: 14px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

/* 3. SHARED BUTTONS */
.btn,
button.primary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;

    min-height: 42px;
    padding: 10px 18px;

    color: #ffffff;
    background: var(--primary);

    border: 1px solid var(--primary);
    border-radius: 7px;

    font-weight: 600;
    text-align: center;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.btn:hover,
button.primary-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
}

/* 4. SHARED FORM ELEMENTS */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;

    color: var(--text);
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 7px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #9aa6b2;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 143, 149, 0.12);
}

/* 5. LOGIN AND REGISTER PAGES */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.auth-header {
    width: 100%;
    padding: 20px;
    text-align: center;
}

.auth-main {
    width: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 20px 40px;
}

.auth-card,
.login-box,
.register-box {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 32px;

    background: var(--surface);
    border: 1px solid rgba(226, 232, 236, 0.8);
    border-radius: 14px;

    box-shadow: var(--shadow);
}

.brand {
    margin-bottom: 28px;
    text-align: center;
}

.brand-mark {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;

    display: flex;
    justify-content: center;
    align-items: center;

    color: #ffffff;
    background: var(--primary);

    border-radius: 12px;

    font-size: 20px;
    font-weight: 700;
}

h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.4;
}

h2 {
    color: var(--text);
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.auth-card button,
.login-box button,
.register-box button {
    width: 100%;
    min-height: 46px;
    margin-top: 5px;
    padding: 12px;

    color: #ffffff;
    background: var(--primary);

    border: none;
    border-radius: 7px;

    font-size: 15px;
    font-weight: 700;

    transition: background 0.2s ease;
}

.auth-card button:hover,
.login-box button:hover,
.register-box button:hover {
    background: var(--primary-dark);
}

.register-link,
.login-link {
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.register-link a,
.login-link a {
    color: var(--primary-dark);
    font-weight: 700;
}

#message {
    margin-top: 15px;
    padding: 12px;

    border-radius: 7px;

    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.alert-info {
    color: var(--primary-dark);
    background: var(--primary-light);
}

.alert-warning {
    color: #8a5b00;
    background: var(--warning-bg);
}

.alert-error {
    color: #991b1b;
    background: var(--danger-bg);
}

.alert-success {
    color: var(--success);
    background: var(--success-bg);
}

/* 6. DASHBOARD SHARED COMPONENTS */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    padding: 18px 24px;

    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-brand {
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 700;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;

    padding: 24px 16px;

    color: #ffffff;
    background: var(--primary-dark);
}

.sidebar a {
    display: block;
    margin-bottom: 6px;
    padding: 12px 14px;

    color: #ffffff;
    border-radius: 7px;
    text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, 0.15);
}

.main-content {
    min-width: 0;
    flex: 1;
    padding: 28px;
}

.page-title {
    margin: 0 0 8px;
    font-size: 24px;
}

.page-description {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
}

.stat-value {
    margin-top: 8px;
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 700;
}

/* 7. DASHBOARD ANALYTICS */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.analytics-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 260px;
    margin: 15px auto 0;
}

.utilization-value {
    margin: 35px 0 15px;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
}

.progress-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 20px;
    background: #e8eeee;
    margin-bottom: 25px;
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: 20px;
    background: var(--primary);
    transition: width 0.5s ease;
}

.utilization-details {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

/* 8. TABLES */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--text);
    background: var(--background);
    font-size: 13px;
    font-weight: 700;
}

tbody tr:hover {
    background: #f8fbfb;
}

/* 9. STATUS LABELS */
.status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    color: var(--success);
    background: var(--success-bg);
}

.status-pending {
    color: var(--warning);
    background: var(--warning-bg);
}

.status-inactive {
    color: var(--danger);
    background: var(--danger-bg);
}

/* 10. FORGOT PASSWORD */
.forgot-password-link {
    text-align: right;
    margin: -8px 0 18px;
    font-size: 14px;
}

.forgot-password-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* 11. RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: 210px;
    }

    .main-content {
        padding: 22px;
    }
}

@media (max-width: 650px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .auth-card,
    .login-box,
    .register-box {
        padding: 26px 22px;
    }

    h1 {
        font-size: 20px;
    }

    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 12px;
    }

    .main-content {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .app-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 18px;
    }
}