/* Google Drive Admin Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Google+Sans:wght@400;500&display=swap');

.gd-storage-container {
    padding: 24px 32px;
    /* Removed max-width to eliminate the huge empty space */
    width: 100%;
    font-family: 'Google Sans', 'Inter', 'Roboto', -apple-system, sans-serif;
    color: #202124;
    animation: gdFadeIn 0.4s ease-out forwards;
    box-sizing: border-box;
}

@keyframes gdFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gd-storage-hero {
    margin-bottom: 40px;
}

.gd-storage-hero-title {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    color: var(--text, #202124);
}

.gd-storage-hero-subtitle {
    font-size: 16px;
    color: #5F6368;
    margin: 0 0 32px 0;
}

.gd-meter-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gd-meter-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.gd-meter-used {
    font-size: 36px;
    font-weight: 500;
    letter-spacing: -1px;
    color: var(--text, #202124);
}

.gd-meter-total {
    font-size: 16px;
    color: #5F6368;
}

.gd-meter-track {
    height: 18px;
    background-color: var(--border-light, #F1F3F4);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.gd-meter-fill-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.gd-anim-segment {
    position: absolute;
    top: 0;
    height: 100%;
    border-right: 2px solid white; /* divider */
    animation: gdGrowWidth 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transform-origin: left;
    transform: scaleX(0);
}

.gd-anim-segment:last-child {
    border-right: none;
}

@keyframes gdGrowWidth {
    to { transform: scaleX(1); }
}

.gd-meter-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.gd-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.gd-legend-item:hover {
    transform: translateY(-2px);
}

.gd-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.gd-legend-text {
    display: flex;
    gap: 6px;
    font-size: 14px;
}

.gd-legend-label {
    color: #5F6368;
}

.gd-legend-size {
    font-weight: 500;
    color: var(--text, #202124);
}

/* Cards Layout */
.gd-cards-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gd-card {
    background-color: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-light, #DADCE0);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    animation: gdFadeInUp 0.6s ease-out both;
}

.gd-card:hover {
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.gd-card:nth-child(1) { animation-delay: 0.1s; }
.gd-card:nth-child(2) { animation-delay: 0.2s; }
.gd-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes gdFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.gd-card-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.gd-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gd-card-title-area h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 4px 0;
    color: var(--text, #202124);
}

.gd-card-title-area p {
    font-size: 14px;
    color: #5F6368;
    margin: 0;
    line-height: 1.4;
}

/* Cleanup specific */
.gd-cleanup-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.gd-cleanup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-light, #DADCE0);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #202124);
    transition: background-color 0.2s ease;
}

.gd-cleanup-item:hover {
    background-color: var(--bg-hover, #F8F9FA);
}

.gd-btn-outline {
    background: transparent;
    border: 1px solid #DADCE0;
    color: #1A73E8;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.gd-btn-outline:hover {
    background-color: #F8F9FA;
    border-color: #D2E3FC;
}

/* Tables */
.gd-table-container {
    overflow-x: auto;
}

/* Keep row action menu from being clipped inside Users table */
.gd-users-table-container {
    overflow: visible;
}

.gd-clean-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.gd-clean-table th {
    text-align: left;
    font-weight: 500;
    color: #5F6368;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light, #DADCE0);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gd-clean-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light, #f1f3f4);
    color: var(--text, #202124);
    vertical-align: middle;
}

.gd-clean-table tr {
    transition: background-color 0.2s ease;
}

.gd-clean-table tbody tr:hover {
    background-color: var(--bg-hover, #F8F9FA);
}

.gd-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gd-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.gd-user-info {
    display: flex;
    flex-direction: column;
}

.gd-user-name {
    font-weight: 500;
    font-family: 'Google Sans', 'Inter', sans-serif;
}

.gd-user-email {
    font-size: 12px;
    color: #5F6368;
}

.gd-usage-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gd-mini-bar {
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background-color: #F1F3F4;
    overflow: hidden;
}

.gd-mini-fill {
    height: 100%;
    background-color: #1A73E8;
    border-radius: 2px;
    animation: gdGrowWidth 1s ease-out forwards;
    transform-origin: left;
    transform: scaleX(0);
}

.gd-file-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gd-file-name {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.gd-file-icon {
    font-size: 18px;
    margin-right: 8px;
}

.gd-sec-text {
    color: #5F6368;
}

.gd-icon-btn {
    background: transparent;
    border: none;
    color: #5F6368;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.gd-icon-btn:hover {
    background-color: #F1F3F4;
    color: #202124;
}

.gd-empty-table {
    text-align: center;
    color: #5F6368;
    padding: 32px !important;
}

.gd-pagination-wrap {
    margin-top: 16px;
    border-top: 1px solid var(--border-light, #f1f3f4);
    padding-top: 16px;
}

/* Tooltip on meter */
.tooltip-host {
    position: relative;
    cursor: pointer;
}

.gd-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: #202124;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.gd-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #202124 transparent transparent transparent;
}

.tooltip-host:hover .gd-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Dashboard Widgets Support */
.gd-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.gd-overview-card {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 16px;
}
.gd-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px; /* Slight round rect for dashboard metrics */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gd-metric-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}
.gd-metric-label {
    font-size: 13px;
    color: #5F6368;
    margin-bottom: 4px;
    font-weight: 500;
}
.gd-metric-value {
    font-size: 24px;
    color: var(--text, #202124);
    font-weight: 400;
    line-height: 1.2;
}
.gd-metric-sub {
    font-size: 12px;
    color: #188038;
    margin-top: 4px;
}

/* Recent Activity inside Dashboard */
.gd-recent-activity {
    display: flex;
    flex-direction: column;
}
.gd-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light, #f1f3f4);
}
.gd-activity-item:last-child {
    border-bottom: none;
}
.gd-activity-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.gd-activity-text {
    font-size: 14px;
    color: var(--text, #202124);
}
.gd-activity-time {
    font-size: 12px;
    color: #5F6368;
    margin-top: 2px;
}

/* Users Page - Filters and Search */
.gd-users-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.gd-search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-hover, #F1F3F4);
    border-radius: 24px;
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    padding: 8px 16px;
    transition: background-color 0.2s, box-shadow 0.2s;
}
.gd-search-bar:focus-within {
    background-color: var(--card-bg, #FFFFFF);
    box-shadow: 0 1px 1px 0 rgba(65,69,73,0.3), 0 1px 3px 1px rgba(65,69,73,0.15);
}
.gd-search-bar input {
    border: none;
    background: transparent;
    font-size: 16px;
    margin-left: 8px;
    width: 100%;
    outline: none;
    color: var(--text, #202124);
}
.gd-filter-chips {
    display: flex;
    gap: 8px;
}
.gd-filter-chip {
    background: var(--card-bg, #FFFFFF);
    border: 1px solid #DADCE0;
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 14px;
    color: #3C4043;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.gd-filter-chip:hover {
    background-color: #F8F9FA;
}
.gd-filter-chip.active {
    background-color: #E8F0FE;
    color: #1967D2;
    border-color: #1967D2;
}

/* Base Primary Button */
.gd-btn-primary {
    background-color: #1A73E8;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    font-family: inherit;
}
.gd-btn-primary:hover {
    background-color: #174EA6;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

/* Badges */
.gd-role-badge, .gd-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}
.gd-role-admin { background-color: rgba(26,115,232,0.1); color: #1967D2; }
.gd-role-user { background-color: rgba(60,64,67,0.1); color: #3C4043; }
.gd-status-active { background-color: rgba(24,128,56,0.1); color: #188038; }
.gd-status-suspended { background-color: rgba(217,48,37,0.1); color: #D93025; }

/* Popup menu */
.gd-popup-menu {
    position: absolute;
    right: 0;
    top: 36px;
    background: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-light, #DADCE0);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 100;
    width: 180px;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.gd-popup-menu.hidden { display: none; }
.gd-popup-menu button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text, #202124);
    font-family: inherit;
}
.gd-popup-menu button:hover { background-color: #F1F3F4; }
.gd-menu-divider { height: 1px; background-color: #F1F3F4; margin: 4px 0; }

/* Drawer */
.gd-drawer {
    position: fixed;
    right: -400px;
    top: 0;
    bottom: 0;
    width: 400px;
    background-color: var(--card-bg, #FFFFFF);
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.gd-drawer.open { right: 0; }
.gd-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.3);
    z-index: 999;
}
.gd-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light, #DADCE0);
}
.gd-drawer-header h3 { margin: 0; font-weight: 500; font-size: 18px; color: var(--text, #202124); }
.gd-drawer-content { padding: 24px; display:flex; flex-direction:column; gap:24px; }
.gd-drawer-profile { display: flex; align-items: center; gap: 16px; }
.gd-avatar-xl { width: 64px; height: 64px; font-size: 24px; }
.gd-profile-info h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text, #202124); }
.gd-profile-info .gd-email { color: #5F6368; font-size: 14px; }
.gd-drawer-tags { display: flex; gap: 8px; }
.gd-divider { height: 1px; background-color: var(--border-light, #DADCE0); width: 100%; border:none; margin:0;}
.gd-drawer-section h4 { margin: 0 0 16px 0; font-size: 14px; font-weight: 500; color: #5F6368; text-transform: uppercase; letter-spacing: 0.5px; }

/* Forms inside material panels */
.gd-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.gd-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #3C4043);
}
.gd-input, .gd-drawer-form .gd-input, .gd-settings-pane .admin-input {
    border: 1px solid #DADCE0;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text, #202124);
    background: transparent;
    transition: border-color 0.2s;
}
.gd-input:focus, .gd-settings-pane .admin-input:focus {
    outline: none;
    border-color: #1A73E8;
    box-shadow: 0 0 0 1px #1A73E8 inset;
}

/* Invite user modal */
.admin-invite-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal.invite-modal-shell {
    width: min(620px, 96vw) !important;
    border-radius: 14px !important;
}
.modal.invite-modal-shell .modal-header h3 {
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.2px;
}
.modal.invite-modal-shell .modal-body {
    padding-top: 12px;
}
.admin-invite-modal .invite-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 8px;
}
.admin-invite-modal .modal-label {
    margin: 0;
    font-size: 13px;
    color: #5f6368;
    font-weight: 500;
}
.admin-invite-modal .admin-input {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #d2d7de;
    background: #fff;
}
.admin-invite-modal .invite-form-grid label[for="invite-email"],
.admin-invite-modal .invite-form-grid #invite-email,
.admin-invite-modal .invite-form-grid label[for="invite-message"],
.admin-invite-modal .invite-form-grid #invite-message {
    grid-column: 1 / -1;
}
.admin-invite-modal .invite-message-input {
    resize: vertical;
    min-height: 96px;
    padding-top: 10px;
}
.admin-invite-modal .panel-sep {
    height: 1px;
    background: #e6e9ee;
    margin: 2px 0 0;
}
.admin-invite-modal .invite-section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
}
.admin-invite-modal .invite-list {
    max-height: 220px;
    overflow: auto;
    border: 1px solid #e6e9ee;
    border-radius: 12px;
    background: #fbfcff;
}
.admin-invite-modal .invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #eceff3;
}
.admin-invite-modal .invite-row:last-child {
    border-bottom: 0;
}
.admin-invite-modal .invite-row-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-invite-modal .invite-row-email {
    font-size: 14px;
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-invite-modal .invite-row-meta {
    font-size: 12px;
    color: #5f6368;
}
.admin-invite-modal .invite-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}
.admin-invite-modal .invite-action-btn {
    font-size: 13px;
    padding: 2px 0;
}
.admin-invite-modal .invite-empty {
    margin: 0;
    padding: 14px 12px;
}

.invite-success-wrap {
    text-align: center;
    padding: 18px 0 8px;
}
.invite-success-icon {
    background: #e6f4ea;
    color: #137333;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.invite-success-title {
    margin: 0 0 8px;
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-size: 22px;
    line-height: 1.2;
    color: #202124;
}
.invite-success-text {
    color: #5f6368;
    font-size: 14px;
    margin: 0 0 20px;
}
.invite-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f3f4;
    border-radius: 10px;
    padding: 8px;
}
.invite-link-field {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Roboto Mono', monospace;
    color: #3c4043;
    font-size: 13px;
    padding: 0 8px;
}
.invite-copy-btn {
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
}

@media (max-width: 700px) {
    .modal.invite-modal-shell {
        width: min(96vw, 96vw) !important;
    }
    .modal.invite-modal-shell .modal-header h3 {
        font-size: 20px;
    }
    .admin-invite-modal .invite-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Tabs */
.gd-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light, #DADCE0);
    overflow-x: auto;
}
.gd-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #5F6368;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display:flex;
    align-items:center;
}
.gd-tab-btn:hover {
    color: #202124;
    background-color: #F8F9FA;
}
.gd-tab-btn.active {
    color: #1A73E8;
    border-bottom-color: #1A73E8;
}

/* Toggles and checkboxes */
.gd-checkbox { width: 18px; height: 18px; accent-color: #1A73E8; cursor: pointer; }
.gd-toggle { position: relative; display: inline-block; width: 40px; height: 24px; }
.gd-toggle input { opacity: 0; width: 0; height: 0; }
.gd-toggle label {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #DADCE0; transition: .4s; border-radius: 24px;
}
.gd-toggle label:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
.gd-toggle input:checked + label { background-color: #1A73E8; }
.gd-toggle input:checked + label:before { transform: translateX(16px); }

/* Activity Details */
.gd-breakdown-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.gd-breakdown-left { display: flex; align-items: center; gap: 8px; color: var(--text, #3C4043); }
.gd-breakdown-size { font-weight: 500; color: var(--text, #202124); }

/* Settings Form specifics */
.gd-settings-pane .admin-form-group { margin-bottom: 20px; }
.gd-settings-pane .admin-form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--text, #202124); }
.gd-settings-pane .admin-subtext { font-size: 12px; color: #5F6368; display: block; margin-top: 4px; }

/* Sidebar Overrides for Admin Panel to match Google Drive perfectly */
.app.admin-mode .sidebar {
    background-color: var(--bg-primary, #ffffff) !important;
    border-right: none !important;
    padding-top: 12px !important;
}

.app.admin-mode .sidebar .admin-nav-item {
    display: flex !important;
    align-items: center;
    color: var(--text, #3c4043) !important;
    border-radius: 999px !important;
    margin: 0 12px 2px 12px !important;
    padding: 0 16px !important;
    height: 40px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'Google Sans', 'Roboto', sans-serif !important;
    text-decoration: none !important;
    transition: background-color 0.2s, color 0.2s !important;
    border: none !important;
}

.app.admin-mode .sidebar .admin-nav-item svg {
    width: 20px !important;
    height: 20px !important;
    margin-right: 16px !important;
    fill: currentColor !important;
    color: #5f6368 !important;
}

.app.admin-mode .sidebar .admin-nav-item:hover {
    background-color: var(--bg-hover, #f1f3f4) !important;
    color: var(--text, #202124) !important;
}

.app.admin-mode .sidebar .admin-nav-item:hover svg {
    color: var(--text, #202124) !important;
}

.app.admin-mode .sidebar .admin-nav-item.active {
    background-color: #c2e7ff !important; /* Material 3 Drive light blue active */
    color: #001d35 !important;
    font-weight: 600 !important;
}

.app.admin-mode .sidebar .admin-nav-item.active svg {
    color: #001d35 !important;
}

.app.admin-mode .sidebar .admin-nav-item.nav-divider {
    display: block !important;
    margin: 8px 0 !important;
    border-top: 1px solid var(--border-light, #dadce0) !important;
    height: 0 !important;
    padding: 0 !important;
}

.app.admin-mode .logo-text {
    color: var(--text, #202124) !important;
}

/* Fix Admin Page Background and Header */
/* Fix Admin Page Background and Header */
.app.admin-mode .admin-page-header {
    background: transparent !important;
    border: none !important;
    padding: 8px 16px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.app.admin-mode .admin-header-left {
    display: flex;
    align-items: center;
}
.app.admin-mode .admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
}
.app.admin-mode .admin-breadcrumb h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    color: #202124;
}
.app.admin-mode .admin-breadcrumb-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 500;
    color: #5f6368;
}
.app.admin-mode .admin-breadcrumb-sep {
    color: #9aa0a6;
    font-size: 20px;
}
.app.admin-mode .admin-header-badge {
    background: #e8eaed;
    color: #3c4043;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.app.admin-mode .admin-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.app.admin-mode .admin-exit-btn {
    height: 38px;
    border-radius: 999px;
    padding: 0 14px;
    font-weight: 600;
}
.app.admin-mode .admin-profile-wrap {
    position: relative;
}
.app.admin-mode .admin-profile-btn {
    height: 38px;
    border-radius: 999px;
    border: 1px solid #dadce0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 8px;
    cursor: pointer;
    color: #202124;
    font-weight: 500;
}
.app.admin-mode .admin-profile-pill-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.app.admin-mode .admin-profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(60,64,67,.2);
    padding: 6px;
    z-index: 20;
}
.app.admin-mode .admin-profile-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    height: 36px;
    border-radius: 8px;
    padding: 0 10px;
    cursor: pointer;
    color: #202124;
}
.app.admin-mode .admin-profile-menu button:hover {
    background: #f1f3f4;
}
.app.admin-mode .admin-shell {
    background: var(--bg-primary, #ffffff) !important;
}
.app.admin-mode .main-content {
    background: var(--bg-primary, #ffffff) !important;
    border-radius: 16px;
    margin-top: 8px;
    margin-right: 8px;
    height: calc(100vh - 16px);
}

/* Admin pages use their own in-page header; keep global topbar compact */
.app.admin-mode .topbar {
    min-height: 56px !important;
    height: 56px !important;
    padding: 8px 12px !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

.app.admin-mode .topbar .search-wrap {
    display: none !important;
}

.app.admin-mode .topbar .topbar-actions {
    margin-left: auto !important;
}

/* Fix huge inputs in Activity and Settings forms */
.gd-settings-pane .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: 800px;
}
.gd-settings-pane .admin-input {
    max-width: 100%;
}
.gd-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 1000px;
}
.gd-filter-grid .gd-input-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #5f6368;
    font-weight: 500;
}
.gd-filter-grid .gd-input {
    width: 100%;
    box-sizing: border-box;
}

/* ── Settings: action bar (save / cancel footer) ── */
.settings-action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    background: var(--bg-secondary, #f8f9fa);
    border-top: 1px solid var(--border-light, #dadce0);
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    z-index: 10;
}
.settings-action-bar .settings-status-error { color: #d93025; font-size: 13px; margin-right: auto; }
.settings-action-bar .settings-status-unsaved { color: #f29900; font-size: 13px; font-weight: 500; }
.settings-action-bar .settings-status-saved {
    color: #188038; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 4px;
}

/* ── Settings: toggle row ── */
.live-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text, #202124);
    cursor: pointer;
    user-select: none;
}
.live-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1A73E8;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Settings: allowed file-type chips ── */
.types-chip-wrap { margin-top: 20px; }
.types-chip-wrap h4 {
    font-size: 13px;
    font-weight: 500;
    color: #5F6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #E8F0FE;
    color: #1967D2;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
}
.admin-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    opacity: 0.7;
}
.admin-chip button:hover { opacity: 1; }
.chip-add-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.filetype-input { max-width: 200px; }
.enter-hint { font-size: 16px; color: #5F6368; }

/* ── Settings: logo upload drop zone ── */
.logo-upload-box {
    border: 2px dashed var(--border-light, #DADCE0);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    color: #5F6368;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.logo-upload-box:hover {
    border-color: #1A73E8;
    background-color: #F8F9FA;
    color: #1A73E8;
}

/* ── Settings: backup progress bar ── */
.backup-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.backup-progress {
    height: 4px;
    background-color: #F1F3F4;
    border-radius: 2px;
    overflow: hidden;
    flex: 1;
    min-width: 100px;
}
.backup-progress span {
    display: block;
    height: 100%;
    background-color: #1A73E8;
    width: 0;
    transition: width 0.3s ease;
}
.backup-form-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(180px, 220px) minmax(160px, 190px);
    gap: 16px;
    align-items: end;
}
.backup-location-group {
    grid-column: 1 / 2;
}

/* ── Settings: backup history table ── */
.admin-table-wrap { margin-top: 20px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left;
    font-weight: 500;
    color: #5F6368;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light, #DADCE0);
    font-size: 13px;
}
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light, #f1f3f4);
    color: var(--text, #202124);
    vertical-align: middle;
}
.admin-table tbody tr:hover td { background-color: var(--bg-hover, #F8F9FA); }
.admin-empty-row { text-align: center; color: #5F6368; padding: 24px !important; }
.backup-row-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.backup-row-actions .gd-btn-outline,
.backup-row-actions .danger-outline-btn {
    padding: 6px 12px;
}

@media (max-width: 1100px) {
    .app.admin-mode .sidebar {
        width: 256px !important;
        min-width: 256px !important;
        max-width: 256px !important;
        left: -276px !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 950 !important;
        border-right: 1px solid #dadce0;
        transition: left .22s ease !important;
    }

    .app.admin-mode .sidebar.open {
        left: 0 !important;
    }

    .app.admin-mode .main-content {
        margin: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        overflow-x: hidden !important;
    }

    .app.admin-mode .topbar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 10px !important;
        min-height: 56px !important;
        height: 56px !important;
    }

    .app.admin-mode .topbar .search-wrap {
        display: none !important;
    }

    .app.admin-mode .topbar .topbar-actions {
        display: none !important;
    }

    .app.admin-mode .topbar .topbar-leading {
        display: flex !important;
    }

    .app.admin-mode .file-list-header {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .app.admin-mode .file-list-header > div:not(.col-name) {
        display: none !important;
    }
    
    .app.admin-mode .file-row {
        grid-template-columns: minmax(0, 1fr) 40px !important;
    }
    .app.admin-mode .file-row > div:not(.col-name):not(.col-actions) {
        display: none !important;
    }

    .app.admin-mode .admin-page-header {
        padding: 10px 12px !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    .app.admin-mode .admin-breadcrumb {
        gap: 8px;
        flex-wrap: wrap;
    }

    .app.admin-mode .admin-breadcrumb-logo {
        font-size: 16px;
        gap: 6px;
    }

    .app.admin-mode .admin-breadcrumb h2 {
        font-size: 24px;
        line-height: 1.12;
    }

    .app.admin-mode .admin-head-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .backup-top-row {
        flex-direction: column;
        align-items: stretch;
    }
    .backup-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .backup-location-group {
        grid-column: auto;
    }
}

/* ── Settings: danger zone ── */
.danger-zone { max-width: 560px; }
.danger-zone h4 { font-size: 16px; font-weight: 500; color: #D93025; margin: 0 0 8px 0; }
.danger-zone > p { font-size: 14px; color: #5F6368; margin: 0 0 20px 0; }
.danger-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.danger-outline-btn {
    background: transparent;
    border: 1px solid #D93025;
    color: #D93025;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
}
.danger-outline-btn:hover { background-color: rgba(217, 48, 37, 0.06); }
.danger-outline-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Activity Table ── */
.activity-time-cell {
    color: #5F6368;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    white-space: nowrap;
}
.activity-target-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-action-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(26,115,232,0.1);
    color: #1A73E8;
    text-transform: capitalize;
}
.activity-action-badge.upload,
.activity-action-badge.login { background: rgba(24,128,56,0.1); color: #188038; }
.activity-action-badge.delete,
.activity-action-badge.failed { background: rgba(217,48,37,0.1); color: #D93025; }
.activity-action-badge.share  { background: rgba(142,36,170,0.1); color: #8E24AA; }
.activity-action-badge.download { background: rgba(26,115,232,0.1); color: #1A73E8; }

.activity-status-ok,
.activity-status-fail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    font-size: 13px;
}
.activity-status-ok   { color: #188038; }
.activity-status-fail { color: #D93025; }

.activity-detail-row { background: var(--bg-hover, #F8F9FA); }
.activity-detail-row td { padding: 16px 24px !important; }
.activity-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    font-size: 13px;
    color: #5F6368;
}
.activity-detail-grid strong { color: var(--text, #202124); }

.activity-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.activity-filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.activity-active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.activity-live-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text, #202124);
}
.activity-live-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1A73E8;
}
.activity-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D93025;
    animation: activity-pulse 1.5s ease-in-out infinite;
}
@keyframes activity-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.75); }
}
.activity-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light, #DADCE0);
}

