/* ==========================================================================
   Aastamangalam Finance - Responsive Admin Panel Styles
   ========================================================================== */

:root {
    --primary: #153e5c;
    --primary-dark: #0d283c;
    --primary-light: #1f5882;
    --accent: #F2BE54;
    --accent-hover: #d49826;
    --sidebar-width: 260px;
    --bg-light: #f4f7fb;
    --text-dark: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   Authentication Pages (Login & Register)
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d283c 0%, #153e5c 50%, #1f5882 100%);
    padding: 30px 15px;
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../img/datapoints.jpg') center/cover;
    opacity: 0.15;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 35px 25px 25px;
    text-align: center;
    color: #ffffff;
    border-bottom: 3px solid var(--accent);
}

.auth-header img {
    max-height: 70px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
}

.auth-header h2 {
    font-family: 'Russo One', sans-serif;
    font-size: 20px;
    margin: 0;
    color: var(--accent);
    letter-spacing: 0.8px;
}

.auth-header p {
    font-size: 13.5px;
    margin: 6px 0 0;
    color: #cbd5e0;
}

.auth-body {
    padding: 30px 30px 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 7px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 15px;
}

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

.form-control {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 62, 92, 0.15);
}

.btn-auth-primary {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(242, 190, 84, 0.35);
}

.btn-auth-primary:hover {
    background: #ffffff;
    color: var(--primary);
    border: 2px solid var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.auth-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.alert-custom {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.alert-danger-custom {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success-custom {
    background-color: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert-custom i {
    margin-right: 10px;
    font-size: 16px;
}

/* ==========================================================================
   Admin Dashboard Layout
   ========================================================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 22px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
    max-height: 60px;
    object-fit: contain;
}

.sidebar-brand h3 {
    margin: 8px 0 0;
    font-size: 13px;
    font-family: 'Russo One', sans-serif;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 13px 22px;
    color: #cbd5e0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu li a i {
    width: 22px;
    font-size: 16px;
    margin-right: 14px;
    color: var(--accent);
}

.sidebar-menu li.active a,
.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left-color: var(--accent);
}

.sidebar-user-box {
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-right: 12px;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-sidebar-logout {
    color: #cbd5e0;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-sidebar-logout:hover {
    color: #fc8181;
}

/* Main Content Area */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    background: #ffffff;
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border-bottom: 1px solid var(--border-color);
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary);
    cursor: pointer;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-website-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: #edf2f7;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-website-link:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Content Container */
.admin-content {
    padding: 30px;
    flex: 1;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 18px;
    flex-shrink: 0;
}

.stat-info h3 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.stat-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Content Panels / Cards */
.admin-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    overflow: hidden;
}

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

.panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2 i {
    color: var(--accent);
}

.panel-body {
    padding: 24px;
}

/* Upload PDF Form */
.upload-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: flex-end;
}

.btn-upload {
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(242, 190, 84, 0.3);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.admin-table thead th {
    background: #f8fafc;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 12px 18px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.admin-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background-color: #f8fafc;
}

.badge-cat {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: var(--primary);
    display: inline-block;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-action-view {
    background-color: #3182ce;
}
.btn-action-view:hover {
    background-color: #2b6cb0;
}

.btn-action-delete {
    background-color: #e53e3e;
}
.btn-action-delete:hover {
    background-color: #c53030;
}

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

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.active {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .btn-sidebar-toggle {
        display: block;
    }
    .admin-topbar {
        padding: 0 15px;
    }
    .admin-content {
        padding: 15px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .upload-grid {
        grid-template-columns: 1fr;
    }
    .auth-card {
        margin: 10px;
    }
}
