@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --color-primary: #155785;
    /* Navy Blue from logo icon */
    --color-primary-light: #206d9f;
    --color-primary-dark: #0b3c61;
    --color-bg: #ffffff;
    --color-secondary: #189788;
    /* Teal from logo icon */
    --color-secondary-light: #22baa8;
    --color-secondary-dark: #106f63;

    --color-accent: #ed8934;
    /* Orange from logo icon */
    --color-accent-light: #f79d50;
    --color-accent-dark: #ca6e21;

    --color-text: #1e293b;
    /* Slate 800 */
    --color-text-muted: #64748b;
    /* Slate 500 */
    --color-bg-light: #ffffff;
    --color-card-bg: #f1f5f9;
    /* Slate 50 */
    --color-border: #e2e8f0;
    /* Slate 200 */

    --color-success: #10b981;
    --color-success-bg: #ecfdf5;
    --color-success-border: #a7f3d0;

    --color-error: #ef4444;
    --color-error-bg: #fef2f2;
    --color-error-border: #fecaca;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-secondary) 100%);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-xl);
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--color-primary);
    text-align: center;
    letter-spacing: -0.025em;
}

/* Logos in forms */
.form-logo {
    text-align: center;
    margin-bottom: 20px;
}

.form-logo img {
    height: 56px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--color-primary-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--color-text);
    background-color: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(24, 151, 136, 0.15);
}

.row {
    display: flex;
    gap: 16px;
}

.row .col {
    flex: 1;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 14px 20px;
    margin-top: 24px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(21, 87, 133, 0.25);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(21, 87, 133, 0.35);
    filter: brightness(1.05);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(21, 87, 133, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

.btn-danger:active {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1.5px solid var(--color-error-border);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1.5px solid var(--color-success-border);
}

.link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.link a {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.link a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Profile / Dashboard specific styles */
.profile-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.profile-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    background-color: #ffffff;
    color: var(--color-text);
}

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

.profile-table td:first-child {
    font-weight: 600;
    color: var(--color-text-muted);
    background-color: var(--color-bg-light);
    width: 38%;
    border-right: 1px solid var(--color-border);
}

/* Hero Section (index.php) */
.hero {
    text-align: center;
    padding: 10px 0;
}

.hero h1 {
    font-size: 34px;
    margin-bottom: 8px;
    color: var(--color-primary);
}

.hero p {
    color: var(--color-text-muted);
    font-size: 16px;
    margin-bottom: 32px;
}

.hero-logo {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo img {
    height: 80px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(21, 87, 133, 0.2));
    transition: transform 0.3s ease;
}

.hero-logo img:hover {
    transform: scale(1.08);
}

.btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(21, 87, 133, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard / Panel Layout with Sidebar */
body.panel-page {
    display: block;
    padding: 0;
    min-height: 100vh;
    background-color: var(--color-bg-light);
}

.panel-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--color-primary-dark);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

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

.sidebar-logo {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-item a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-item.active a {
    color: #ffffff;
    background-color: var(--color-secondary);
    box-shadow: 0 4px 12px rgba(24, 151, 136, 0.2);
}

.sidebar-item.logout-item {
    margin-top: auto;
}

.sidebar-item.logout-item a {
    color: #fca5a5;
}

.sidebar-item.logout-item a:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ffffff;
}

.sidebar-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-divider {
    padding: 10px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.sidebar-back { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 8px; }

/* Sidebar Submenu */
.sidebar-submenu { list-style: none; }

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 2px 8px;
}

.sidebar-section-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-section-items {
    display: none;
    padding-left: 8px;
    list-style: none;
}

.sidebar-section-items.show {
    display: block;
}

.sidebar-section-header .sidebar-arrow {
    transition: transform 0.2s;
    font-size: 10px;
}

.sidebar-section-header.open .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 2px 8px;
}

.sidebar-submenu-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-submenu-items {
    display: none;
    padding-left: 16px;
    list-style: none;
}

.sidebar-submenu-items.show {
    display: block;
}

.sidebar-section-items .sidebar-item a {
    padding-left: 16px;
    font-size: 12px;
}

.sidebar-submenu-items .sidebar-item a {
    padding-left: 40px;
    font-size: 12px;
}

.sidebar-submenu-header .sidebar-arrow {
    transition: transform 0.2s;
    font-size: 10px;
}

.sidebar-submenu-header.open .sidebar-arrow {
    transform: rotate(180deg);
}

/* Main Content Area */
.panel-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.panel-header {
    background-color: #ffffff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.panel-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.panel-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.panel-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.panel-content {
    background-color: #fff;
    padding: 40px 24px;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.panel-content .container {
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive Overlays & Drawers */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 90;
}

@media (max-width: 768px) {
    .panel-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.open {
        display: block;
    }

    body .panel-content {
        margin-bottom: 20px;
    }

    .pagination {
        gap: 4px !important;
        margin-top: 12px !important;
    }

    .pagination a, .pagination span {
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 6px !important;
        font-size: 12px !important;
    }

    .pagination .page-numbers {
        display: none !important;
    }

    .pagination .page-select-wrap {
        display: flex !important;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: var(--color-text-muted);
    }

    .pagination .page-select {
        padding: 4px 8px;
        border: 1px solid var(--color-border);
        border-radius: 6px;
        font-size: 12px;
        background: #fff;
        color: var(--color-text);
    }

    .pagination .pagination-info {
        display: none !important;
    }
}