:root {
    --primary: #0f172a;
    --primary-soft: #1e293b;
    --secondary: #0284c7;
    --secondary-dark: #0369a1;
    --accent: #0d9488;

    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;

    --success-bg: #dcfce7;
    --success-text: #166534;

    --danger-bg: #fee2e2;
    --danger-text: #991b1b;

    --warning-bg: #fef3c7;
    --warning-text: #92400e;

    --sidebar-width: 280px;
    --navbar-height: 76px;
    --radius: 16px;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--secondary);
}

a:hover {
    color: var(--secondary-dark);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--primary);
    color: #ffffff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.1;
}

.sidebar-header p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

.sidebar-user {
    margin: 18px 16px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.sidebar-user strong {
    display: block;
    font-size: 14px;
}

.sidebar-user span {
    color: #cbd5e1;
    font-size: 12px;
}

.sidebar-nav {
    padding: 4px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--secondary);
    color: #ffffff;
}

.sidebar-icon {
    width: 22px;
    text-align: center;
}

.sidebar-link-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sidebar-link-disabled small {
    margin-left: auto;
    font-size: 10px;
    color: #94a3b8;
}

.sidebar-footer {
    padding: 18px 20px;
    color: #94a3b8;
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer p {
    margin: 0 0 4px;
}

.sidebar-footer strong {
    color: #ffffff;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
}

.navbar {
    height: var(--navbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar-left h1 {
    margin: 0;
    font-size: 21px;
    color: var(--primary);
}

.navbar-left p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 18px;
    cursor: pointer;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-user-info {
    text-align: right;
}

.navbar-user-info strong {
    display: block;
    font-size: 14px;
}

.navbar-user-info span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.navbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.logout-link {
    text-decoration: none;
    color: var(--danger-text);
    background: var(--danger-bg);
    padding: 9px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
}

.logout-link:hover {
    color: var(--danger-text);
    opacity: 0.9;
}

.app-content {
    flex: 1;
    padding: 26px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card h2 {
    margin-top: 0;
    color: var(--primary);
}

.card p {
    line-height: 1.5;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    gap: 20px;
}

.info-row strong {
    color: var(--primary);
}

.info-row span {
    color: var(--muted);
    text-align: right;
    word-break: break-word;
}

.badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 600;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn {
    display: inline-block;
    border: none;
    text-decoration: none;
    padding: 11px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.btn-primary {
    background: var(--secondary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--secondary-dark);
    color: #ffffff;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.form-control {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.app-footer {
    padding: 18px 26px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.auth-page {
    min-height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 16px;
    background:
        radial-gradient(circle at top left, rgba(2, 132, 199, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(13, 148, 136, 0.16), transparent 30%),
        var(--bg);
}

.auth-brand {
    max-width: 480px;
    width: 100%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand h1 {
    margin: 0;
    color: var(--primary);
    font-size: 24px;
}

.auth-brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    color: var(--muted);
    padding: 14px;
    font-size: 13px;
}

.app-overlay {
    display: none;
}

code {
    background: #e2e8f0;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 13px;
}