:root {
    --slate-navy: #1e293b;
    --cobalt-blue: #2563eb;
    --emerald-green: #10b981;
    --slate-700: #334155;
    --slate-100: #f1f5f9;
    --bg-light: #f8fafc;
    --page-tint: #eef4ff;
    --surface-white: rgba(255, 255, 255, 0.88);
    --surface-border: rgba(148, 163, 184, 0.18);
    --border-radius: 8px;
    --border-radius-lg: 28px;
    --header-height: 64px;
    --sidebar-width: 260px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.08);
    --cobalt-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 26%),
        radial-gradient(circle at left 18%, rgba(16, 185, 129, 0.12), transparent 22%),
        linear-gradient(180deg, #f8fbff 0%, #eef5ff 44%, #f7fafc 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: transparent;
    color: var(--slate-navy);
    margin: 0;
    font-size: 14px;
    min-height: 100vh;
}

/* Layout Containers */
.app-container {
    display: flex;
    min-height: 100vh;
    background: transparent;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--slate-navy);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 1050;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(241, 245, 249, 0.3));
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        width: 100%;
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}

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

.header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
}

/* Sidebar Styling */
.sidebar-header {
    padding: 24px;
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

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

.sidebar-nav a.active {
    background-color: var(--cobalt-blue);
    color: #ffffff;
}

.sidebar-nav i {
    font-size: 1.1rem;
    width: 24px;
}

/* Sidebar Dropdown Styling */
.sidebar-dropdown {
    width: 100%;
}

.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.dropdown-chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown-trigger.open .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    margin: 0 4px;
}

.dropdown-content.show {
    max-height: 500px; /* Adjust as needed */
    margin-bottom: 8px;
}

.dropdown-content a {
    padding: 10px 16px 10px 48px !important;
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin-bottom: 0 !important;
}

.dropdown-content a:hover {
    color: #ffffff !important;
    background: transparent !important;
}

.dropdown-content a.active {
    color: #ffffff !important;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Header UI */
.company-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* Common Components */
.page-shell {
    padding: 26px;
    flex-grow: 1;
}

.page-surface {
    min-height: calc(100vh - var(--header-height) - 52px);
    padding: 28px 30px 34px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--surface-border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9)),
        linear-gradient(180deg, rgba(238, 244, 255, 0.55), rgba(255, 255, 255, 0.2));
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.page-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 20%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.07), transparent 18%);
    pointer-events: none;
}

.page-surface > * {
    position: relative;
    z-index: 1;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.btn {
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--cobalt-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-success {
    background-color: var(--emerald-green);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.form-control {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--cobalt-blue);
    box-shadow: var(--cobalt-ring);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 18px;
    overflow: hidden;
}

.table th {
    text-align: left;
    padding: 15px 16px;
    border-bottom: 1px solid #dbe5f1;
    color: #64748b;
    font-weight: 600;
    background: rgba(241, 245, 249, 0.78);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(241, 245, 249, 0.9);
}

.recycle-btn {
    background-color: #f59e0b;
    color: white;
}

.logout-btn {
    background-color: #ef4444;
    color: white;
}

/* Legacy Aliases for backward compatibility with existing views */
.aws-page-header { margin-bottom: 24px; }

/* CSS-only extension alternatives */
.aws-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}
.aws-btn {
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}
.aws-btn-primary {
    background-color: var(--cobalt-blue);
    color: white;
}
.aws-btn-primary:hover {
    background-color: #1d4ed8;
}
.aws-input:focus {
    border-color: var(--cobalt-blue);
    box-shadow: var(--cobalt-ring);
}
.aws-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
.aws-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 18px;
    overflow: hidden;
}
.aws-table th {
    text-align: left;
    padding: 15px 16px;
    border-bottom: 1px solid #dbe5f1;
    color: #64748b;
    font-weight: 600;
    background: rgba(241, 245, 249, 0.78);
}
.aws-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(241, 245, 249, 0.9);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 4px 0;
}

.table-pagination-info {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.table-pagination-btn {
    border: 1px solid #dbe5f1;
    background: rgba(255, 255, 255, 0.92);
    color: #1e293b;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.table-pagination-btn:hover:not(:disabled) {
    border-color: #2563eb;
    color: #2563eb;
}

.table-pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

input,
select,
textarea {
    background-color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 768px) {
    .page-shell {
        padding: 16px;
    }

    .page-surface {
        padding: 20px 18px 24px;
        min-height: calc(100vh - var(--header-height) - 32px);
        border-radius: 22px;
    }
}
